Skip to content

Marking a Tiny message unread counts by time, and a chat hidden without a read marker comes back - #1042

Closed
unRekable wants to merge 1 commit into
mainfrom
fix/mark-unread-id-order
Closed

unRekable wants to merge 1 commit into
mainfrom
fix/mark-unread-id-order

Conversation

@unRekable

Copy link
Copy Markdown
Collaborator

What changed and why

Tiny message ids are UUIDs, so their text is no clock. "Mark unread from here" compared ids as text: on the middle of three messages it found nothing before it and counted all three as unread (#1012). The marker and the badge now go by the order the window reads: time, then the server's sequence, and the id only where both tie. A marker for a message the store does not hold is still compared as text, which is the order of an id that carries its own.

The other half: a hidden conversation came back on a new live message only when its id was a UUID, or when the message was newer than the last one read. A conversation forgotten before anything marked where it was read has no marker, so on a network whose ids sort in order it stayed hidden for good: no Inbox row, no notification. A hidden row with no marker now comes back on the next live message on every network, as it already did on Tiny.

Type

  • feature
  • fix
  • perf
  • refactor
  • chore
  • docs

Platforms

  • windows
  • macos
  • linux
  • android
  • ios

Proof

Scenario: e2e/scenarios/tiny-mark-unread-order

The scenario runs the real chatd against the loopback Tiny server in fixture.py, the way tiny-unread-stays does, and speaks chatd's socket. Bea writes three messages into one direct: the oldest has the id that sorts last, and the middle one the id that sorts first. The driver reads the chat and asks chatd to mark it unread from the middle message, as the window does. The Inbox must then count two unread, and the marker must sit on the oldest message. Compared as text, all three are unread and the marker is empty, so this driver fails on main.

Lab run: not made. The driver was not run against the real chatd on a lab host.

Also run on this branch on Windows before this pull request: cargo build --workspace --all-targets --features tinyclient/gui, then cargo nextest run --workspace --features tinyclient/gui (3682 passed, 28 skipped; among them four new store tests, and one existing test gained the check that the message which brings a chat back notifies), then cargo test --workspace --doc --features tinyclient/gui.

Compatibility

No protocol change.

Risk and rollback

This changes what a person sees: a hidden conversation without a read marker reappears in the Inbox on its next live message, on every network. That is how Teams describes its own hide ("until a new message arrives") and how Tiny already behaved. Two store tests used such a row as a fixture and expected it to stay hidden; they now hide it after its message, and their expectations are unchanged. Revert the commit.

Release note

"Mark unread" on a Tiny message counts by time, and a chat hidden without a read marker comes back on its next message.

Part of #1012.

…nd a chat forgotten with no read marker comes back
@itz4blitz

Copy link
Copy Markdown
Collaborator

Shipped in the 0.2.94 release via #1046.

@itz4blitz itz4blitz closed this Dec 5, 2026
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.

2 participants