Skip to content

fixes related to room v12 and sytest#19898

Open
FrenchGithubUser wants to merge 3 commits into
element-hq:developfrom
famedly:tt/room-v12
Open

fixes related to room v12 and sytest#19898
FrenchGithubUser wants to merge 3 commits into
element-hq:developfrom
famedly:tt/room-v12

Conversation

@FrenchGithubUser

@FrenchGithubUser FrenchGithubUser commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Discovered while writing matrix-org/sytest#1429

Those might be split into their separate PRs if necessary.

  • Fix third-party (3pid) invites over federation failing intermittently in version 12 rooms, whose room IDs no longer encode a server name.
  • Fix /createRoom intermittently failing with a 500 error in version 12 rooms when the same user creates several rooms at once, due to colliding room IDs.

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

in version 12 rooms, whose room IDs no longer encode a server name
@FrenchGithubUser FrenchGithubUser changed the title fix: third-party (3pid) invites over federation failing intermittently fix: third-party (3pid) invites over federation failing intermittently in version 12 rooms, whose room IDs no longer encode a server name Jun 30, 2026
@FrenchGithubUser FrenchGithubUser changed the title fix: third-party (3pid) invites over federation failing intermittently in version 12 rooms, whose room IDs no longer encode a server name fixes related to room v12 and sytest Jul 1, 2026
rooms when the same user creates several rooms at once, due to colliding
room IDs
@FrenchGithubUser
FrenchGithubUser marked this pull request as ready for review July 1, 2026 15:06
@FrenchGithubUser
FrenchGithubUser requested a review from a team as a code owner July 1, 2026 15:06
@anoadragon453
anoadragon453 requested a review from Copilot July 15, 2026 13:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses two intermittent failures introduced/observed with room version 12 (MSC4291-style) rooms: (1) room ID collisions during concurrent /createRoom calls, and (2) third-party invite forwarding over federation incorrectly treating v12 room IDs as destination server names.

Changes:

  • Add retry logic for MSC4291 room creation when the derived room ID collides, by perturbing origin_server_ts.
  • Fix 3PID invite forwarding destination selection to avoid interpreting domainless v12 room IDs as federation destinations.
  • Add a Towncrier newsfragment documenting both bugfixes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
synapse/handlers/room.py Retries MSC4291 create-event generation on room ID collisions to avoid intermittent /createRoom 500s under concurrency.
synapse/handlers/federation.py Adjusts 3PID invite forwarding destinations so v12+ room IDs without domains don’t trigger invalid-destination failures.
changelog.d/19898.bugfix Adds release note entries for the two v12-related bugfixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread synapse/handlers/room.py
Comment on lines +1454 to +1456
except StoreError:
attempts += 1
continue

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this mirrors the existing _generate_and_create_room_id, which swallows all StoreErrors the same way; distinguishing collisions from real errors is worth doing but as a separate cleanup to both

Comment thread synapse/handlers/room.py
Comment thread synapse/handlers/federation.py
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.

2 participants