Skip to content

ARCCHR0016: Concurrency flag is ignored when the handler returns exact concurrency scopes

[EventSourceType], [EventStreamType] and [EventStreamId] take a concurrency flag that adds the attribute to the concurrency scope Arc derives for the command’s events. When Handle() returns EventsWithConcurrencyScopes, the returned scopes are used exactly as they are and nothing is derived from the attributes, so concurrency: true does nothing.

The rule fires on a model-bound [Command] whose public instance Handle() returns EventsWithConcurrencyScopes directly, in a Task<> or ValueTask<>, inside a Result<>/OneOf<> branch, or as an element of a tuple. It reports the concurrency argument whether it is passed positionally or by name. concurrency: false and a missing argument are not reported.

Warning

[Command]
[EventStreamId("settlements", concurrency: true)] // ARCCHR0016
public record SettleFunds(EventSourceId AccountId)
{
public Task<EventsWithConcurrencyScopes> Handle(IStreamReads streams) => ...;
}
[Command]
[EventStreamId("settlements")]
public record SettleFunds(EventSourceId AccountId)
{
public Task<EventsWithConcurrencyScopes> Handle(IStreamReads streams) => ...;
}

Remove concurrency: true deletes the argument and keeps the rest of the attribute. Fix All is supported.

A definition ([EventSource<T>] with concurrency dimensions) is a shared policy that other writers also follow, so the command cannot remove it. An exact scope, for example from StreamDecision.Append, intentionally replaces it for this append. The rule therefore only looks at the attributes on the command itself.