fix(kernel): signal targeted channel revocation - #128
Open
mp-blurify wants to merge 2 commits into
Open
Conversation
mp-blurify
requested review from
damianrzepka,
klaudia-blazyczek-blurify,
marek-chmielowski-blurify and
zaxovaiko
as code owners
September 1, 2026 10:20
marek-chmielowski-blurify
approved these changes
Sep 2, 2026
zaxovaiko
approved these changes
Sep 3, 2026
zaxovaiko
left a comment
Member
There was a problem hiding this comment.
lgtm, fix conflicts, please
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
Adds provider-agnostic targeted channel revocation semantics to the first-party SSE transport. Revoked users now receive a chat:access-revoked signal before their message and signal subscriptions are removed.
Why
Private-room deletion or membership removal previously pruned the affected user鈥檚 in-process subscriptions without notifying the SSE client. As a result, the client continued treating a deleted private room as active until reload.
The implementation now:
Regression coverage verifies the transport behavior and confirms that private-room deletion and member removal invoke the revocation path.
The change also stabilizes an existing session-expiry test by comparing timestamps using the PostgreSQL clock rather than the potentially skewed Node.js clock.
Alternatives considered
Broadcasting a revocation event to every channel subscriber was rejected because it would expose user-specific access changes to unrelated users.
Closing the SSE stream without a semantic signal was rejected because consumers need the revoked channel identifier to update local state correctly.
Implementing the behavior only in the consumer or an Ably-specific adapter was rejected because the realtime transport contract is provider-agnostic and the first-party SSE implementation must satisfy it directly.
Risks
Consumers using the SSE fallback must consume chat.streamSignals and handle chat:access-revoked to update their UI immediately. Existing consumers that do not handle the signal remain compatible but will not benefit from immediate local state reconciliation.