Skip to content

client-api: Update MSC3814 dehydrated device events to GET - #8

Open
livenson wants to merge 1 commit into
matrix-construct:tuwunel-changesfrom
livenson:msc3814-get-events
Open

livenson wants to merge 1 commit into
matrix-construct:tuwunel-changesfrom
livenson:msc3814-get-events

Conversation

@livenson

@livenson livenson commented Oct 10, 2026 •

Copy link
Copy Markdown

MSC3814 now fetches the events of a dehydrated device with GET .../dehydrated_device/{device_id}/events, with the batch token in the from query parameter. It also leaves next_batch out of the response once there are no more events. The MSC commits are matrix-org/matrix-spec-proposals@72c06568 and @9ea19e2f, and Synapse implements them in element-hq/synapse#19896 and #19897.

This updates get_events::unstable to that definition:

  • The request is GET with #[ruma_api(query)] from.
  • The response's next_batch is skip_serializing_if = "Option::is_none".

The previous POST definition moves unchanged to get_events::unstable_v1, so a homeserver can keep serving clients that still use it, such as matrix-rust-sdk. This follows how update_delayed_event::unstable_v1 kept the earlier MSC4140 shape.

Why it matters: matrix-js-sdk 42 and later uses the GET. A homeserver that only routes the POST answers it with 405. The client then replaces its dehydrated device, and the room keys queued for that device are lost. A "next_batch": null on the last page also makes those clients restart paging from the first page indefinitely.

The companion Tuwunel change, which serves both methods, is matrix-construct/tuwunel#646.

Checks:

  • Nightly cargo fmt is clean.
  • cargo clippy -p ruma-client-api --features client,server,unstable-msc3814 -- -D warnings is clean.
  • The dehydrated-device tests pass, including the three new ones: GET request serialization with from, server-side query parsing, and a last page without next_batch.

The MSC now fetches the events of a dehydrated device with `GET` and the
batch token in the `from` query parameter, and the response omits
`next_batch` once there are no more events to retrieve.

The previous `POST` definition is kept as `unstable_v1` so homeservers can
continue to serve clients that predate the change.
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