Repository navigation
fix(realtime): send migration events only to project readers - #14805
Conversation
Migration events went to the bare organization team role on the console, which every member holds, and were also published into the project's own subscription tree. They carry project data, so address them to the project's read roles, the same roles that can read the project over HTTP, and publish them on the console only. Co-Authored-By: Claude <[email protected]>
|
Review complete. No issues found — approved ✅. This change restricts realtime migration events to console-side sessions that hold read permissions on the target project, closing a channel where project-scoped subscribers previously received migration payloads.
The production changes are internally consistent: role derivation matches the existing Reviewed commit: 78169eb |
🟢 Tier S · Ready to mergeMigration realtime events are addressed to project-reader roles and routed through the console subscription tree. The tests cover delivery to an authorized organization owner and exclusion of both a sibling-project member and a project-tree subscription. Latest changes: The newest commit adds a project-tree websocket to the migration E2E test and factors the negative-delivery checks into a shared helper.
📂 Walkthrough · 4
Reviewed the commits since |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
Co-Authored-By: Claude <[email protected]>
…n-events fix(realtime): send migration events only to project readers (cherry picked from commit 156119b)
Summary
Migration realtime events (
migrations.*) were addressed to the bare organization team role on the console, which every organization member holds, and were also published into the project's own subscription tree. They are now addressed to the project's read roles (organization owner/developer, or aproject-<id>-owner/-developerrole), the same roles that can read the project over HTTP, and published on the console only.Changes
Messaging/Adapter/Realtime.php:fromPayload()givesmigrationsevents the project's read permissions as roles;ruleskeeps its current mapping.Workers/Migrations.php: publish migration updates to theconsolesubscriber only. Console clients connect withproject=console, and in a project's own tree team roles belong to project teams, not the organization.options.downloadUrlstays in the event payload: the Console's export box merges realtime payloads into its cache and shows the Download button from that field, and everyone who now receives the event can already read the same URL throughGET /v1/migrations/:migrationId. Removing it would need a Console change to refetch on completion. The API model is unchanged.Tests
MessagingTest::testFromPayloadMigrationsReachOnlyProjectReaderschecks the role mapping and that only a connection with a role on the project matches; it fails onmain.RealtimeConsoleMigrationsTest, verified by CI): the organization owner receives a project's migration event on the console channel, and a member scoped to a sibling project does not.Related: appwrite-labs/cloud#6666