'limited' flag is set on sync v3 room joins #839
Labels
No labels
Bug
Cherry-picking
Database
Dependencies
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/Federation
Matrix/MSC
Matrix/Media
Meta
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Wont fix
old/ci/cd
old/rust
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: continuwuation/continuwuity#839
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/src/api/client/sync/v3.rs#L873-L878
Here, joined_since_last_sync is true if the user is joining the room for the "first time" in terms of this sync (e.g., initial sync, or joined since the last sync since token). The specification describes the limited flag as indicating that the server has omitted some events from the current batch due to a large number of events occurring since the last sync, creating a "gap" that the client can backfill.
Setting limited to true just because joined_since_last_sync is true might be a misinterpretation - given clients already have a pagination token here.
Investigate client behaviour?
Related to #779 ?
Even if this is related to 799, not sure fixing this would fix that too - 799's issue is the room state never makes it down sync. Definitely worth looking into though
okay what im gathering is our sync watcher is just a bit borky over all
To add some additional context, my main server (nexy7574.co.uk) has been using near 100% of its allocated CPU for several months straight now. I assumed this was just due to being in far too many rooms, and a consequence of federation traffic. Today, I took a poke at my reverse proxy logs to see if it was someone deliberately spamming me, and yes, it was someone deliberately spamming me. It was me, spamming /sync 30 times a second, per session, across about 5 sessions.
Things I noticed while fixing:
I suspect what is happening is the server is possibly using stale membership events to determine if a user is in a room, and then realising that they aren't actually based on the current state while generating the sync payload, and then just getting confused and returning a limited timeline. This sounds somewhat related to the aforementioned
joined_since_last_sync
.This is what each sync response looked like, for future reference. The next_batch never actually incremented (apart from when expected)
I also had this issue with some matrix dot org room. I used the force-leave-room command to fix, and the room limited: true with no events is no longer in my element sync replies