Add and use SyncStateAfterHas(...) for TestDelayedEvents#874
Merged
Conversation
1 task
MadLittleMods
commented
May 13, 2026
Comment on lines
-33
to
-41
| // A filter for `/sync` that excludes timeline events. | ||
| // | ||
| // This is useful if you want to see `state` in the `/sync` response without the pesky | ||
| // de-duplication with `timeline` that traditional `/sync` does. | ||
| const NoTimelineSyncFilter = `{ | ||
| "room": { | ||
| "timeline": { "limit": 0 } | ||
| } | ||
| }` |
Collaborator
Author
There was a problem hiding this comment.
Adding the new standard SyncStateAfterHas(...) check allows us to remove this custom filter and tribal knowledge around how it works.
MadLittleMods
commented
May 13, 2026
| // | ||
| // Note that the `state_after` section of a sync response will not contain the entire | ||
| // state of the room for incremental or `lazy_load_members` syncs. | ||
| func SyncStateAfterHas(roomID string, check func(gjson.Result) bool) SyncCheckOpt { |
Collaborator
Author
There was a problem hiding this comment.
I considered updating SyncStateHas(...) to include checking for state_after but perhaps someone explicitly wants to check state vs state_after for some specific tests.
anoadragon453
approved these changes
May 15, 2026
Member
anoadragon453
left a comment
There was a problem hiding this comment.
Much clearer indeed. Nice cleanup, thank you!
Collaborator
Author
|
Thanks for the review @anoadragon453 🦘 |
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.
Add and use
SyncStateAfterHas(...)forTestDelayedEventsFollow-up to #869 (comment)
Dev notes
UseStateAfterwas introduced in #842Other previous notes on using
state_afterfor membership checks, #813 (comment)Pull Request Checklist