Fix mobile unread badges and read state sync#422
Open
wesbillman wants to merge 1 commit intomainfrom
Open
Conversation
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
Fixes the mobile unread badge/read-state work so it is stable under real pairing and live subscription behavior.
kind:30078sync, live merge, publish debouncing, and graceful local fallback when the relay/token cannot support remote read-state writes.#h, and tracks the full channel event surface so livelastMessageAtbehavior matches reload behavior.users:writein newly minted mobile pairing tokens for remote read-state publish.Root Cause
The unread work introduced overlapping live subscriptions: the channel list and the open channel could both receive the same relay event. Mobile relay-session dedupe was keyed only by event id, so whichever subscription flushed first suppressed delivery to the other subscription. That produced the observed state where the unread dot appeared but the open channel did not receive the message until reload.
Separately, mobile read-state publishing exercises NIP-RS
kind:30078; stale relays or older paired tokens can reject that path even though normal desktop channel messaging works. Mobile now degrades to local read state for those permanent remote failures.Validation
flutter testcargo test --manifest-path desktop/src-tauri/Cargo.toml mobile_pairing_token_includes_users_write_scopeNotes
No uncommitted
sprout-relaycode changes are included here. Runtime relay support forkind:30078comes from the existing NIP-RS relay work in #420; this PR keeps the new work scoped to mobile behavior plus the desktop mobile-token scope needed for new pairings.