Skip to content

Change the MSC3814 dehydrated device /events endpoint paging to match spec conventions#19897

Open
andybalaam wants to merge 9 commits into
element-hq:developfrom
andybalaam:andybalaam/dehydrated-device-events-from
Open

Change the MSC3814 dehydrated device /events endpoint paging to match spec conventions#19897
andybalaam wants to merge 9 commits into
element-hq:developfrom
andybalaam:andybalaam/dehydrated-device-events-from

Conversation

@andybalaam

@andybalaam andybalaam commented Jun 30, 2026

Copy link
Copy Markdown
Member

To match the spec requirements for pagination:

  • rename the query parameter of /org.matrix.msc3814.v1/dehydrated_device/[device_id]/events to from, and
  • omit next_batch from the response content if there are no more events to fetch

This matches the changes that are coming in MSC3814.

The previous change #19896 kept the old POST API to support old clients. This preserves that compatibility, so the POST API still works how it used to.

Depends on #19896
Part of element-hq/element-meta#2799

Pull Request Checklist

@andybalaam andybalaam force-pushed the andybalaam/dehydrated-device-events-from branch from da79173 to 641d479 Compare June 30, 2026 13:55
@andybalaam andybalaam force-pushed the andybalaam/dehydrated-device-events-from branch from 641d479 to 0383801 Compare July 1, 2026 09:29
@andybalaam andybalaam marked this pull request as ready for review July 1, 2026 10:31
@andybalaam andybalaam requested a review from a team as a code owner July 1, 2026 10:31
@andybalaam andybalaam force-pushed the andybalaam/dehydrated-device-events-from branch from 0383801 to faca7e1 Compare July 1, 2026 10:31
Comment thread tests/rest/client/test_devices.py Outdated
Comment thread synapse/handlers/devicemessage.py Outdated
Comment on lines +434 to +435
if len(messages) > 0:
ret["next_batch"] = f"d{stream_id}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This means that the client will have to make an extra round-trip when it gets to the end of the pending messages, just to double-check that there are no more messages. Could we make get_messages_for_device return an additional boolean return value, indicating whether or not the result was "limited"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

How about c701266 ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think that's valid in the type system!

Seems reasonable in principle though.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ouch, thank you. I've pushed fixes for this and a couple of other problems.

andybalaam and others added 2 commits July 1, 2026 13:47
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@andybalaam andybalaam requested a review from richvdh July 1, 2026 14:52
@andybalaam andybalaam marked this pull request as draft July 2, 2026 09:48

@richvdh richvdh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@andybalaam andybalaam marked this pull request as ready for review July 2, 2026 10:13
@sandhose sandhose self-assigned this Jul 2, 2026
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.

3 participants