Repository navigation
fix(realtime): deliver membership delete event to removed member - #13780
Merged
Conversation
Signed-off-by: Jyotirmoy Roy <[email protected]>
Contributor
|
Signed-off-by: Jyotirmoy Roy <[email protected]>
HarshMN2345
changed the base branch from
main
to
cursor/membership-realtime-delete-98fa
October 12, 2026 08:02
HarshMN2345
merged commit Oct 12, 2026
ecbae14
into
appwrite:cursor/membership-realtime-delete-98fa
1 check passed
2 tasks done
This was referenced Oct 13, 2026
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.
What does this PR do?
Real-time subscribers who were removed from a team never received the
teams.{teamId}.memberships.{membershipId}.deleteevent. The pubsub handler inapp/realtime.phprebuilt the affected user's roles (revoking theirteam:{teamId}role) before computing receivers, so the very member being removed was filtered out of the fan-out.The handler now computes receivers against the current subscription tree first, so the removed member still matches while their team role is being revoked. A post-rebuild fan-out is merged in afterwards so membership create events still reach the newly added member.
Test Plan
testChannelMembershipsDelete(tests/e2e/Services/Realtime/RealtimeCustomClientTest.php) a fresh user subscribes tomemberships, an admin creates a team + membership (create event received), then deletes the membership (delete event still received on the removed member's connection).tests/unit/Messaging: 39 tests pass.composer lint(Pint) and PHPStan level 4 clean on both changed files.Related PRs and Issues
Checklist