Skip to content

Client does not detect event_seq gaps to trigger resume (§8.3) #47

@nficano

Description

@nficano

Category: spec-conformance Severity: minor
Location: src/Arcp.Client/ArcpClient.Dispatch.cs:19-23
Spec: ARCP v1.1 §8.3

What

The client overwrites _lastReceivedSeq with each received event_seq but never checks that the new seq is the expected successor. Spec §8.3 says a client that receives an unexpected gap SHOULD treat the session as broken and attempt resume; this client silently accepts gaps.

Evidence

await foreach (var env in _transport.ReceiveAsync(cancellationToken).ConfigureAwait(false))
{
    if (env.EventSeq is { } seq) Interlocked.Exchange(ref _lastReceivedSeq, seq);
    await DispatchAsync(env, cancellationToken).ConfigureAwait(false);
}

Proposed fix

Compare each incoming event_seq to the last seen value; on an unexpected gap, surface the condition (and, once resume is wired, attempt resume) rather than continuing as if the stream were intact.

Acceptance criteria

  • Receiving an event_seq that skips the expected next value raises a detectable broken-session signal on the client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions