Repository navigation
fix(events): authorize the events queued before a stream opens once - #8718
Merged
Merged
Conversation
Events that arrived before the stream opened each queued their own authorization behind the write chain, so ten of them made ten serial checks. They now share one that starts when the stream opens, while each is still written in order. - Comments explain the two defensive guards no test can reach: the fast path's empty-queue check and the rejection handler on each authorization. - The mothership and MCP event route tests reset their ready mocks between tests.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Contributor
|
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was previously deployed
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.
Summary
Review follow-ups to #8700's SSE opening gate.
readymocks inbeforeEach, so amockReturnValueOncecannot leak into the next test.Type of Change
Testing
writes every event queued before it opened once one authorization passes: ten events are queued before the open, and each authorization is a promise the test controls. Settling only the first writes all ten, in order. On staging it fails, because only the first event can be written before the next serial check.Checklist