Skip to content

Suggestions for #935 - #1

Open
AndrewFerr wants to merge 9 commits into
barodeur:msc4140-authenticated-assertionsfrom
AndrewFerr:msc4140-authenticated-assertions_review
Open

AndrewFerr wants to merge 9 commits into
barodeur:msc4140-authenticated-assertionsfrom
AndrewFerr:msc4140-authenticated-assertions_review

Conversation

@AndrewFerr

Copy link
Copy Markdown

This merges matrix-org#935 with main and adapts the tests to matrix-org#928.

To see how this PR compares to matrix-org#935, one way is to compare the diffs of each PR, like so:

diff <(git diff --merge-base main barodeur/msc4140-authenticated-assertions) <(git diff main AndrewFerr/msc4140-authenticated-assertions_review)
< index 1d9f6db..4994885 100644
---
> index e974d75..ea9c766 100644
5,6c5,6
< @@ -62,6 +62,44 @@ func TestDelayedEvents(t *testing.T) {
<  		})
---
> @@ -90,6 +90,43 @@ func TestDelayedEvents(t *testing.T) {
>  		matchDelayedEvents(t, user, delayedEventsNumberEqual(0))
16,18c16,17
< +			getPathForState(roomID, eventType, "to_manage_without_a_token"),
< +			client.WithJSONBody(t, map[string]interface{}{}),
< +			getDelayQueryParam("100000"),
---
> +			getPathForDelayedEvent(roomID, eventType, "txn-delayed-mgmt-requires-auth"),
> +			client.WithJSONBody(t, getDelayedStateEventBody(100000, "to_manage_without_a_token", map[string]interface{}{})),
50c49
< @@ -243,6 +281,76 @@ func TestDelayedEvents(t *testing.T) {
---
> @@ -270,6 +307,75 @@ func TestDelayedEvents(t *testing.T) {
67,68c66,67
< +			getPathForState(roomID, eventType, stateKey),
< +			client.WithJSONBody(t, map[string]interface{}{
---
> +			getPathForDelayedEvent(roomID, eventType, "txn-delayed-mgmt-only-for-self"),
> +			client.WithJSONBody(t, getDelayedStateEventBody(1500, stateKey, map[string]interface{}{
70,71c69
< +			}),
< +			getDelayQueryParam("1500"),
---
> +			})),

barodeur and others added 9 commits September 25, 2026 11:40
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>
Co-authored-by: Quentin Gliech <quenting@element.io>
* Add minimal /send_join MSC4242 Complement tests

This is to serve as regression tests for:
 - rejoining a room not working because we skipped seen events during processing
 - rejected events (due to cascading) being accepted because we didn't persist
   rejection status in-memory alongside the state group

* Add TestMSC4242RejectionCascadesOnRejoin

* Add TestMSC4242RejoinMergesOldAndNewStateDAGBranches

* Review comments
…-endpoint

MSC4140: schedule delayed events through the dedicated endpoint
Resolve conflicts that were caused by the merge getting tripped up on
some code that the new tests have in common with pre-existing tests.

Also, adapt the new tests use the dedicated endpoint for scheduling
delayed events, as was done in matrix-org#928.
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.

4 participants