Skip to content

fix(poll): return events from sources with no subscriptions - #98

Merged
leggetter merged 3 commits into
mainfrom
fix/poll-no-connection-requests
Nov 5, 2026
Merged

leggetter merged 3 commits into
mainfrom
fix/poll-no-connection-requests

Conversation

@leggetter

@leggetter leggetter commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

On a bridge with no subscriptions, the poll tools (wait_for_event, poll_events, events/poll, watch) and get_event / list_events returned no events. A source has a connection only per subscription, so Event Gateway rejected every request as NO_CONNECTION, and poll listed only accepted requests. They now also read verified requests rejected as NO_CONNECTION; VERIFICATION_FAILED is still dropped. Broken since 0.8.0, when the inbound connection was removed.

Details and testing

Why not create a connection for poll instead: reading the stored requests needs no Event Gateway resources and adds no events to the project's usage. It also returns requests from before the first poll, so catch-up works from setup on. Senders are unaffected: a request to a source with no connection still gets 200 (GitHub's delivery log showed 200 for every one).

Changes:

  • src/core/event-history.ts: isEventRequest, verified and either accepted or rejected only as NO_CONNECTION, used by toEvent (get_event, list_events).
  • src/core/hookdeck.ts: the poll listing drops status=accepted (listAcceptedRequests is now listPollRequests).
  • src/core/poll.ts: skips non-event requests before the watermark logic, so a failed signature can't hold the cursor.
  • docs/ARCHITECTURE.md: the live window query, and "Which requests are events".

Tested:

  • tsc --noEmit clean, 432 tests pass. New tests return a NO_CONNECTION request and drop a VERIFICATION_FAILED one, in poll and in the history (get_event, list_events).
  • Edge cases (unit): a subscription starting and ending on one cursor, a redelivery first rejected then accepted, catch-up after a long gap (as watch resumes), replay from a webhook cursor, and the arguments filter. The end-to-end poll test now uses a NO_CONNECTION request, as Event Gateway records it on a bridge with no subscriptions. With the old behavior, 7 of these fail.
  • Live, 5 Nov: a new Hookdeck project, setup with a GitHub source, serve from this branch, no subscriptions. Claude Code waiting with wait_for_event on github.issues got a newly opened issue 5 s after it was opened. Before the fix, the same test returned nothing, and all 8 requests to the source were NO_CONNECTION.
  • Not tested live: the plugin's watch, Cursor and Codex (same poll path).
  • Retention: Event Gateway stores a NO_CONNECTION request like an accepted one (core createRequest.ts: the same request and event data path; retention by plan, 3 days on the free plan, with no branch on rejection_cause), so catch-up reaches as far back either way.

🤖 Generated with Claude Code

leggetter and others added 3 commits November 5, 2026 17:44
A source has a connection only per subscription, so until something
subscribes, Event Gateway rejects its requests as NO_CONNECTION (the
sender still gets 200, and the request is kept, verified, with its
data). Poll mode listed only accepted requests, so wait_for_event,
poll_events, events/poll, watch, get_event and list_events returned
nothing on a bridge with no subscriptions. They now also read verified
requests rejected as NO_CONNECTION. Broken since 0.8.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leggetter
leggetter merged commit 471090b into main Nov 5, 2026
2 checks passed
@leggetter
leggetter deleted the fix/poll-no-connection-requests branch November 5, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant