Skip to content

Remove undocumented transaction ID variants of various room endpoints#19557

Open
tulir wants to merge 3 commits intoelement-hq:developfrom
tulir:tulir/delete-unspecced-send
Open

Remove undocumented transaction ID variants of various room endpoints#19557
tulir wants to merge 3 commits intoelement-hq:developfrom
tulir:tulir/delete-unspecced-send

Conversation

@tulir
Copy link
Contributor

@tulir tulir commented Mar 13, 2026

Fixes #12375

Depends on matrix-org/sytest#1419 and matrix-org/complement#850

Removes:

  • POST /rooms/{roomId}/send/{eventType}
  • POST /rooms/{roomId}/redact/{eventId}
  • PUT /createRoom/{txnId}
  • PUT /rooms/{roomId}/forget/{roomId}/{txnId}
  • PUT /rooms/{roomId}/join/{txnId}
  • PUT /rooms/{roomId}/invite/{txnId}
  • PUT /rooms/{roomId}/leave/{txnId}
  • PUT /rooms/{roomId}/ban/{txnId}
  • PUT /rooms/{roomId}/unban/{txnId}
  • PUT /rooms/{roomId}/kick/{txnId}

Pull Request Checklist

@tulir tulir requested a review from a team as a code owner March 13, 2026 21:57
@reivilibre
Copy link
Contributor

reivilibre commented Mar 18, 2026

Thanks for bringing this up, this cleanup is very overdue.

Had a quick scour of matrix.org logs and two immediate concerns popping out:

Not immediately seeing any other uses of the others, should probably be careful and double-check though.

(also discussed internally)

@tulir
Copy link
Contributor Author

tulir commented Mar 18, 2026

Yeah the /send one is the most commonly used one, so that should be called out in release notes (perhaps even one or two releases early before the change actually lands?). Most of the endpoints seemed to exist as an unintended side-effect of register_txn_path as they were never specified in any form.

POST /send existed in the first ever spec that was written down: https://spec.matrix.org/historical/legacy/#post-matrix-client-api-v1-rooms-roomid-send-eventtype (but it was removed before the first release in late 2015, it's not present in https://spec.matrix.org/historical/client_server/r0.0.0.html)

MadLittleMods pushed a commit to matrix-org/complement that referenced this pull request Mar 18, 2026
For element-hq/synapse#19557

Signed-off-by: Tulir Asokan <tulir@maunium.net>
Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

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

Happy with this, but we need to make some unfortunate concessions as noted.

Everything else, I'm happy to approve the removal of, after not seeing any usage on m.org.

# TODO: Needs unit testing for generic events + feedback
class RoomSendEventRestServlet(TransactionRestServlet):
CATEGORY = "Event sending requests"
PATTERNS = client_patterns(
Copy link
Contributor

Choose a reason for hiding this comment

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

Sad to say, but after discussing with @erikjohnston, we need to preserve /rooms/.../send/... without the txnId on r0 and api/v1 as well.

They've been recently used on m.org and it's going to be hard to just turn these off.

Should comment that although api/v1 is genuine (legacy/historical), r0 was an accidental mistake that is widely used in practice.

I'd be somewhat keen on somehow cracking down on it (e.g. restrict based on user registration date?) but that'd definitely be follow-up PR territory.


class RoomRedactEventRestServlet(TransactionRestServlet):
CATEGORY = "Event sending requests"
PATTERNS = client_patterns(
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry to say we need to keep the non-txnId form on r0 only for now, for Element iOS Classic (stopping people from redacting is not a fun bug).


Happy to throw away the other versions though.

We should comment that this is out of spec for ECiOS and link to the ticket element-hq/element-ios#8011

In a follow-up PR I would not be against adding a user-agent check to ensure it's only ECiOS that can use this, to stop anyone else depending on it. (Needs further consideration though, I don't know if this would also backfire on ECiOS forks. Should probably give some grace time for a fix anyway.)

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.

synapse implements unspecced POST /_matrix/client/v3/rooms/{roomId}/send/{eventType}

2 participants