Skip to content

Subscription history flags are ignored #27

@nficano

Description

@nficano

SubscribeAsync exposes history and fromEventSeq, and the README describes optional history replay for subscriptions, but SessionState.HandleSubscribeAsync only acknowledges the subscription. The method sets Replayed = sub.History in the response without actually replaying prior events, and the inline comment states that history replay is not implemented. A subscriber that requests history can therefore believe replay happened while receiving only future live events.

The relevant locations are src/Arcp.Client/ArcpClient.Subscriptions.cs:12, src/Arcp.Client/ArcpClient.Subscriptions.cs:22, src/Arcp.Runtime/SessionState.Jobs.cs:90, src/Arcp.Runtime/SessionState.Jobs.cs:98, and README.md:216.

Fix prompt: Implement subscription history replay or change the public contract so it does not claim support. The implementation should retain per-job event history or index session event logs by job id, honor JobSubscribePayload.History and FromEventSeq, send matching buffered job.event envelopes before live events, and set JobSubscribedPayload.Replayed only when replay was actually attempted. Add an integration test where a job emits events before a second session subscribes with history: true, then assert the subscriber receives the buffered events in sequence before live events.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingseverity:mediumMedium severity

    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