fix(msc4186): make timeline_limit optional in sliding sync request#4
Open
ltoenjes wants to merge 1 commit intomatrix-construct:tuwunel-changesfrom
Open
Conversation
Add `#[serde(default)]` to `ListConfig::timeline_limit` so that clients which omit `timeline_limit` from their sliding sync list requests don't get a 400 M_BAD_JSON deserialization error. While MSC4186 marks `timeline_limit` as required, older matrix-rust-sdk builds (e.g. matrix-rust-components-swift ≤ 26.01.04) omit it from list configurations. Synapse resolved the same issue (element-hq/synapse#17704) by accepting requests without `timeline_limit` and defaulting to 0. The `ListConfig` struct already derives `Default`, so `UInt::default()` (0) is the natural fallback — no timeline events returned unless the client explicitly requests them. Ref: ruma#1914, element-hq/synapse#17704
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
#[serde(default)]toListConfig::timeline_limitso that clients which omittimeline_limitfrom their sliding sync list requests don't get a400 M_BAD_JSONdeserialization error.While MSC4186 marks
timeline_limitas required, oldermatrix-rust-sdkbuilds (e.g.matrix-rust-components-swift≤ 26.01.04) omit it from list configurations. The server currently rejects these requests with:Synapse resolved the same issue (element-hq/synapse#17704) by accepting requests without
timeline_limitand defaulting to 0.The
ListConfigstruct already derivesDefault, soUInt::default()(0) is the natural fallback — no timeline events returned unless the client explicitly requests them.References
timeline_limitrequired