Skip to content

MSC4140: schedule delayed events through the dedicated endpoint - #928

Draft
barodeur wants to merge 2 commits into
matrix-org:mainfrom
barodeur:msc4140-delayed-event-endpoint
Draft

barodeur wants to merge 2 commits into
matrix-org:mainfrom
barodeur:msc4140-delayed-event-endpoint

Conversation

@barodeur

Copy link
Copy Markdown
Contributor

This is a sister PR to element-hq/synapse#19354

MSC4140 schedules delayed events with PUT /rooms/{roomId}/delayed_event/{eventType}/{txnId}, taking delay_ms, content and, for state events, state_key in the body. The tests in tests/msc4140 schedule delayed events with the org.matrix.msc4140.delay query parameter on /send and /state, which the MSC now lists as a rejected alternative.

This PR:

  • moves the existing tests to PUT /_matrix/client/unstable/org.matrix.msc4140/rooms/{roomId}/delayed_event/{eventType}/{txnId}, and drops the query parameter form
  • adds tests to ensure
    • the endpoint is transactional: the same txnId gives back the same delay_id
    • a missing, zero or negative delay_ms is rejected with a 400

Signed-off-by: Paul Chobert paul@chobert.fr

MSC4140 schedules delayed events with
`PUT /rooms/{roomId}/delayed_event/{eventType}/{txnId}`, taking `delay_ms`,
`content` and, for state events, `state_key` in the body. Scheduling
through the `org.matrix.msc4140.delay` query parameter on `/send` and
`/state` is now one of the MSC's rejected alternatives.

Schedule every delayed event through the unstable form of the endpoint,
giving state events a transaction ID of their own. The existing
"same txnID" subtest now checks that the endpoint is transactional, and
the state event tests check that a state event scheduled through it
lands as room state. A new test checks that a missing, zero or negative
`delay_ms` is rejected with a 400.

One test still schedules a message event and a state event through the
query parameter, so that form stays covered until homeservers drop it.

Signed-off-by: Paul Chobert <paul@chobert.fr>
MSC4140 lists scheduling delayed events through the
`org.matrix.msc4140.delay` query parameter on `/send` and `/state` as a
rejected alternative to the dedicated endpoint, so it is not part of
the MSC to test for. Remove the test that still used it, along with
the `getPathForSend` and `getDelayQueryParam` helpers only it needed.

Signed-off-by: Paul Chobert <paul@chobert.fr>
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