Skip to content

Send 0 notification counts unconditionally in sync v3 - #564

Open
ruka-hamanasu wants to merge 2 commits into
matrix-construct:devfrom
ruka-hamanasu:syncv3-busy-unread-bug
Open

Send 0 notification counts unconditionally in sync v3#564
ruka-hamanasu wants to merge 2 commits into
matrix-construct:devfrom
ruka-hamanasu:syncv3-busy-unread-bug

Conversation

@ruka-hamanasu

@ruka-hamanasu ruka-hamanasu commented Aug 28, 2026

Copy link
Copy Markdown

What does this PR do?

Previously, if a client updated its read receipt in the same sync round in which a non-notifying timeline event (reactions, edits) occurs, Tuwunel was not emitting a notification count of 0 (or any notification count). Because future syncs without further notifications would keep the notification count as 0, that means that any client relying only on seeing the 0 notification count (for example FluffyChat) would never reset its notification count and the room would remain marked as unread.

This PR includes both a shell script to reproduce the problem (see the instructions contained within) and the fix, with unit tests.

The code here is currently running on my homeserver (matrix.agiadn.org) along with #565, and along with some FluffyChat fixes (I'll link that PR when I put it up), FluffyChat is now marking rooms as read in all circumstances.

Checklist

  • Code is formatted with nightly cargo fmt and satisfies clippy and
    rustc lints; any allowed lint is justified by an obvious reason or a
    comment.
  • Complement compliance changes (new passes or new failures), if any,
    are noted in the description above.
  • [n/a] Config option changes were made in src/core/config/mod.rs doc
    comments and the regenerated tuwunel-example.toml is committed.
  • [n/a] User-facing changes are reflected in docs/.
  • I agree that my changes may be licensed under the Apache-2.0 licence
    and my conduct is in line with the Contributor's Covenant and
    Tuwunel's Code of Conduct.

Ruka Hamanasu added 2 commits August 28, 2026 10:24
Previously, if a client updated its read receipt in the same sync
round in which a non-notifying timeline event (reactions, edits)
occurs, Tuwunel was not emitting a notification count of 0 (or any
notification count). Because future syncs without further
notifications would keep the notification count as 0, that means that
any client relying only on seeing the 0 notification count (for
example FluffyChat) would never reset its notification count and the
room would remain marked as unread.

This PR includes both a shell script to reproduce the problem (see the
instructions contained within) and the fix, with unit tests.
@ruka-hamanasu

Copy link
Copy Markdown
Author

CI is failing on changes I did not make, so I'm going to leave those failures for the maintainers to decide about.

@ruka-hamanasu
ruka-hamanasu marked this pull request as ready for review August 28, 2026 20:46
@ruka-hamanasu
ruka-hamanasu changed the base branch from main to dev August 28, 2026 21:13
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