Repository navigation
Keep a local mark-read from being undone by a stale network count - #146
Merged
Merged
Conversation
Tiny OpenSpace refresh was restoring unread after this install had already caught up, because set_counts trusted every network badge even when our last_read was ahead or the list omitted a cursor. Co-authored-by: Cursor <cursoragent@cursor.com>
The stale-count guard was treating every omitted last_read as a Tiny refresh, which blocked Discord's CHANNEL_UNREAD_UPDATE and unopened-channel MESSAGE_CREATE paths that intentionally pass no cursor with a newer updated time. Co-authored-by: Cursor <cursoragent@cursor.com>
Loading a Slack thread was advancing last_read past Slack's marker because past outgoing replies cleared unread like a send, so the stale-count guard then ignored Slack's real unread=1. Only a live send clears now. Co-authored-by: Cursor <cursoragent@cursor.com>
…live. Teams (and the shell) store the pending row with unread=false; after history stopped clearing on outgoing, that left the badge up until an echo whose timestamp could not beat pending's updated time. Pending outgoing clears again; past history still does not. Co-authored-by: Cursor <cursoragent@cursor.com>
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
OpenSpacerefresh calledset_countswith a stale unread (and often nolast_readon channels).set_countsnow keeps a locallast_readthat is ahead of the network's cursor, and never restores a badge when the list omits a cursor while this install is already caught up.a_stale_network_count_does_not_undo_a_local_read(failed red before the guard, green after).Proof
mark_readto the newest id,set_counts(unread=2, last_read=None)returned changed and leftunread=2— the Tiny channel refresh shape.unread=0; an older network cursor cannot rewindlast_read; a newer network cursor still wins.cargo test -p chatd --lib --no-default-features store::tests— 24 passed.Test plan
Made with Cursor