Skip to content

Use a single room per server-user pair for events#3910

Draft
IanCal wants to merge 8 commits intomainfrom
cs-9552-refactor-realm-event-sending-to-use-realm-server-session
Draft

Use a single room per server-user pair for events#3910
IanCal wants to merge 8 commits intomainfrom
cs-9552-refactor-realm-event-sending-to-use-realm-server-session

Conversation

@IanCal
Copy link
Contributor

@IanCal IanCal commented Jan 27, 2026

Currently we require that every realm has its own user added to matrix, and every realm-user pair has a unique room.

Instead, we can have a single server user, and a single dm room for events between the server and user.

This means that creating a new realm requires just creating a new realm, not a realm and user and room.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7cd147b2c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +76 to +80
'JOIN realm_user_permissions rup',
'ON rup.username = sr.matrix_user_id',
'WHERE rup.realm_url =',
param(realmURL),
'AND (rup.read = true OR rup.write = true)',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include public permissions when selecting session rooms

This query now only returns session rooms for users that have explicit realm_user_permissions rows (it joins on rup.username = sr.matrix_user_id). For realms that are world‑readable via the '*' permission row, users who only have public access will not match this join, so fetchAllSessionRooms returns no rooms for them. Because NodeAdapter.broadcastRealmEvent relies on this mapping, those public users will stop receiving realm events (e.g. incremental index invalidations) even though they can read the realm. This regression happens specifically for realms that are readable via '*' but have no per‑user permission rows.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Only specifically mentioned users with read or write access are now going to be notified of updates. This is an expected and OK change. Pinging all users if we change catalog could be a huge issue, and should be solved in a different way so this drop of functionality is expected.

@github-actions
Copy link

Preview deployments

@IanCal IanCal marked this pull request as draft January 27, 2026 15:08
@github-actions
Copy link

github-actions bot commented Jan 27, 2026

Host Test Results

    1 files  ±  0      1 suites  ±0   1h 24m 53s ⏱️ - 20m 45s
1 571 tests  - 366  1 540 ✅  - 380  12 💤  - 5   0 ❌ ± 0  19 🔥 +19 
1 583 runs   - 369  1 533 ✅  - 402  12 💤  - 5  19 ❌ +19  19 🔥 +19 

For more details on these errors, see this check.

Results for commit 02f9b25. ± Comparison against base commit 00abc16.

This pull request removes 371 and adds 5 tests. Note that renamed tests count towards both.
Chrome ‑ Acceptance | Catalog | real catalog app: visiting /catalog/ renders the catalog index card
Chrome ‑ Acceptance | Code patches tests: LLM mode event controls auto-apply of code patches with timestamp checking
Chrome ‑ Acceptance | Code patches tests: action bar disappears when "Cancel" button is clicked
Chrome ‑ Acceptance | Code patches tests: automatic Accept All spinner appears in Act mode for multiple patches
Chrome ‑ Acceptance | Code patches tests: can create new files using the search/replace block
Chrome ‑ Acceptance | Code patches tests: can patch code
Chrome ‑ Acceptance | Code patches tests: can patch code and execute command using "Accept All" button
Chrome ‑ Acceptance | Code patches tests: can restore content of a patched file to its original state
Chrome ‑ Acceptance | Code patches tests: does not display the action bar when the streaming is cancelled
Chrome ‑ Acceptance | Code patches tests: empty file shows generating content while streaming a new file patch
…
Chrome ‑ Acceptance | Query Fields | host respects server-populated results: client falls back to live search when server-side cross-realm query has errors
Chrome ‑ Acceptance | Query Fields | host respects server-populated results: explicit CardTypeFilter hydrates from server without re-fetch
Chrome ‑ Acceptance | Query Fields | host respects server-populated results: fallback search preserves the type filter from the query definition
Chrome ‑ Acceptance | Query Fields | host respects server-populated results: fallback search works with an explicit CardTypeFilter (no predicate)
Chrome ‑ Integration | Command | host command schema generation test > command schema generation: getInputJsonSchema for InviteUserToRoomCommand

♻️ This comment has been updated with latest results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant