Repository navigation
fix(app): the unread mark no longer comes back after a restart - #259
Merged
Merged
Conversation
The app kept what the owner had seen only in the WebView's localStorage, and its leveldb went back days (the writes of 8 to 10 October were in a log that no longer counted), so replies read long ago were marked again. The daemon now keeps until when each bot was read (chat.read, a new bots.read_through column and Bot.readThrough), and the mark takes the largest of the two.
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.
Replies the owner had read days before showed unread again, with a dot, after a restart.
Found in the owner's own data: the app kept what it had seen only in the WebView's
localStorage. Its leveldb had gone back to the state of 8 Oct 14:17, and the log with the writes of 8 to 10 Oct was not part of it any more, so the entry of the SDR agent (read on 9 Oct) was gone and its reply of 8 Oct 23:10 counted as new. The daemon's data was fine: no reply had been touched.chat.read(the app already called it when a chat is seen) now writesbots.read_through(migration 0029; it never goes back) andBot.readThroughcarries it.chat.readfrommarkSeen, so "Mark as read" and opening a chat both count, and the unread mark (and the failed-routine mark on the icon) uses the largest of its own record and the daemon's.Checks:
cargo test --workspace, clippy, fmt,pnpm check; new tests for the store, the RPC and the screen.Manual step: read a reply, quit the app, clear its storage (or reinstall) and open it: the agent is not marked unread again.