Repository navigation
fix(realtime): deliver membership delete events to the removed member - #14210
Conversation
Signed-off-by: Jyotirmoy Roy <[email protected]>
Signed-off-by: Jyotirmoy Roy <[email protected]>
The delete is published only to the team role, and the realtime worker re-resolves the removed member before fan-out, so that client no longer matches. Include the subject's user role on the delete event.
Security rulesNo new WARNING or ERROR findings from security rules. 32 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
|
@hansi-codes review |
🟢 Tier S · Ready to mergeMembership delete events include the removed member's user role as well as the team role, so the member can receive the event after their team access is revoked while teammates continue to receive it. Unit coverage checks routing for the removed member, teammates, and unrelated users, and an end-to-end test covers membership creation and deletion delivery. The latest change clarifies how the worker refreshes subscriptions before event matching. Latest changes: Updated the routing comment to explain that the worker refreshes the member's subscriptions with current roles before matching the delete event.
📂 Walkthrough · 3
Merged |
…e-event-13768 fix(realtime): deliver membership delete event to removed member
…uild Membership delete events now carry the removed member's user role, so the worker no longer needs to collect receivers before rebuilding connections or scan the tree twice for other permission changes.
|
Review complete. No issues found — approved ✅. The change addresses a gap where a removed team member's connection re-resolution strips their
Reviewed commit: c24ef7a |
The comment now names the subscription tree the worker rebuilds before matching.
Brings in Android passkey origins (#14353) and membership delete events for the removed member (#14210). Ported to database 8.0: the platforms fingerprints attribute as Attribute::string, and Id in place of ID in the realtime adapter and the new tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What does this PR do?
Fixes #13768. Deleting a team membership did not emit a realtime delete event to the removed member's client SDK. Membership create already did.
Membership events are published only to
team:{teamId}. The realtime worker treats membership changes as permission changes and re-resolves that user's open connections before fan-out. On create, that re-resolve grants the team role, so the event matches. On delete, the team role is already gone, so the same connection never matches and the client receives nothing.Realtime::fromPayload()now also addressesteams.{teamId}.memberships.{membershipId}.deleteto the membership subject'suser:{userId}(taken from the membership payload). Teammates still match the team role. Create and update stay team-only.Test Plan
php vendor/bin/phpunit --no-configuration --bootstrap vendor/autoload.php tests/unit/Messaging/MessagingTest.php --filter testMembershipDeleteReachesSubjectAfterTeamRoleIsRevokedThe new test checks that a delete event includes the subject user role and the team role, that a connection subscribed only as that user (the post-revocation state) receives it, that a remaining teammate receives it, and that an unrelated user does not. Create and update are still addressed only to the team role.
Full
tests/unit/Messaging/MessagingTest.php(40 tests) passed.tests/e2e/Services/Realtime/RealtimeCustomClientTest.php::testChannelMembershipsDeletecomes from fix(realtime): deliver membership delete event to removed member #13780 by ItsRoy69, merged into this branch. It subscribes the member tomemberships, adds and then deletes their membership, and expects both the create and the delete event. fix(realtime): deliver membership delete event to removed member #13780's worker change (collecting receivers before the connection rebuild and scanning again for other permission changes) is not kept: with the delete event addressed to the member's user role, the single scan after the rebuild already reaches them.Related PRs and Issues
Checklist