Repository navigation
fix(poll): return events from sources with no subscriptions - #98
Merged
Merged
Conversation
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>
…n-requests # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a bridge with no subscriptions, the poll tools (
wait_for_event,poll_events,events/poll,watch) andget_event/list_eventsreturned no events. A source has a connection only per subscription, so Event Gateway rejected every request asNO_CONNECTION, and poll listed only accepted requests. They now also read verified requests rejected asNO_CONNECTION;VERIFICATION_FAILEDis still dropped. Broken since 0.8.0, when the inbound connection was removed.wait_for_event, and a real GitHub issue that never arrived.CHANGELOG.mdadds anUnreleasedsection, as docs: list Codex and Cursor as tested poll clients #94 and fix(plugin): say the watch skill needs the plugin #95 do: whichever merges later needs a small rebase.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
setupon. Senders are unaffected: a request to a source with no connection still gets200(GitHub's delivery log showed 200 for every one).Changes:
src/core/event-history.ts:isEventRequest, verified and either accepted or rejected only asNO_CONNECTION, used bytoEvent(get_event,list_events).src/core/hookdeck.ts: the poll listing dropsstatus=accepted(listAcceptedRequestsis nowlistPollRequests).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 --noEmitclean, 432 tests pass. New tests return aNO_CONNECTIONrequest and drop aVERIFICATION_FAILEDone, in poll and in the history (get_event,list_events).watchresumes), replay from a webhook cursor, and the arguments filter. The end-to-end poll test now uses aNO_CONNECTIONrequest, as Event Gateway records it on a bridge with no subscriptions. With the old behavior, 7 of these fail.setupwith a GitHub source,servefrom this branch, no subscriptions. Claude Code waiting withwait_for_eventongithub.issuesgot 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 wereNO_CONNECTION.watch, Cursor and Codex (same poll path).NO_CONNECTIONrequest like an accepted one (corecreateRequest.ts: the same request and event data path; retention by plan, 3 days on the free plan, with no branch onrejection_cause), so catch-up reaches as far back either way.🤖 Generated with Claude Code