Skip to content

Make subscribe_job attach even when from_event_seq is omitted #27

@nficano

Description

@nficano

Arcp::Client#subscribe_job creates a local queue at lib/arcp/client.rb:149, but it only sends a job.subscribe envelope when the subscribe feature is negotiated and from_event_seq is truthy at lib/arcp/client.rb:152. A caller that uses the natural default subscribe_job(job_id: id) never attaches to the runtime, so observer-side subscriptions can block forever waiting on a local queue that no server fanout path knows about. The method also silently skips the feature requirement when from_event_seq is omitted, which hides negotiation mistakes instead of raising Arcp::Errors::UnnegotiatedFeature.

Fix prompt: Change subscribe_job so an explicit subscription always sends job.subscribe whenever the job is not already locally owned by the same client stream, including the default from_event_seq: nil case. Require the subscribe feature before sending, preserve the existing submitter-owned stream behavior for handles returned by submit_job, and add integration specs for an observer session subscribing with no from_event_seq, with from_event_seq: 0, and with the subscribe feature absent.

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