Repository navigation
Remember unread across restarts, from the server's read markers - #1105
Merged
Merged
Conversation
Pairs with Gryt-chat/server#346. Pushed as a branch rather than a PR because it is incomplete, and handed over rather than carried on. Done: - useUnreadTracker gains setServerUnread(host, counts), which replaces what the window had counted. A conversation the server leaves out has no marker and reads as caught up, not as everything unread. The doc comment no longer says counting starts when the window connected, because it no longer does. - registerServerSocketEvents asks for read:list on the same two moments it asks for mentions -- a reload and a rejoin -- and applies the reply. Not done: - Nothing emits read:set yet, so nothing is ever recorded as read. The site is serverView's channel-opened effect, which calls markChannelRead; the newest message id has to come from useChat, which is destructured below it, so the emit needs its own effect further down rather than a line in that one. - check-unread-tracker still tests the old model and will need rewriting. - Mark as read, in MarkAsReadItem.tsx, has no message id to send. Either the server accepts read:set without one as "everything here", or the client finds the newest id for a conversation it may not have open. - Channels only, by the same argument as the server side: a DM's marker would be a read receipt on an encrypted message. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pairs with Gryt-chat/server#346. read:set goes out when a channel is opened, when a message lands in the open one, and from Mark as read. Without a message id the server reads up to its newest message, so opening a channel and marking it read need no id. It ignores a DM. The server's counts replace this window's only for conversations it has a marker for. A channel never opened keeps what the window counted, where before the reply wiped it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Client half of server#346, finding 2 from the beta.12 testing. Unread used to be counted only in memory from when the window connected, so it reset on every restart and on a new machine.
read:setgoes out when a channel is opened, when a message lands in the channel you have open, and from Mark as read. Mark as read covers a channel, a folder and the whole server. Opening a channel and Mark as read send no message id, and the server reads up to its newest message. That's in One Tailwind utilities layer, not two (GRYT-858) #346 too.read:listis asked for on reload and on rejoin, as mentions already are. Its counts replace this window's only for conversations the server has a marker for. A channel you've never opened keeps what the window counted.check-unread-trackergets cases for the merge.The first commit is from the Windows session, which started this and handed it over unfinished. The second finishes it.
Things to check:
read:setper arriving message can hit the server's limit of 60 a minute. Dropped ones are harmless, because the next one moves the marker past them. But every accepted one sends back a fullread:list.🤖 Generated with Claude Code