fix(tips): show unread tip count on the scanner Tips tab badge - #1156
Merged
Conversation
SessionState.tipsUnreadCount is kept up to date by RealSessionController (observing TIP_DM unread conversations) and re-emits when a tip push triggers a feed refresh — but ScannerNavigationBar never forwarded it into the NavigationBarState it builds, so NavigationBarState.tipUnreadCount stayed at its default 0 and the Tips tab badge never showed or updated. Pass state.tipsUnreadCount through as tipUnreadCount. (Note the naming mismatch: SessionState.tipsUnreadCount vs NavigationBarState.tipUnreadCount.)
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.
Problem
Tip chat push notifications don't update the badge on the scanner's Tips tab. In fact the badge never shows a count at all — it's effectively pinned to
0.Root cause
The unread-count data flows correctly right up to the last hop, then gets dropped:
RealSessionControllerobserveschatCoordinator.observeUnreadConversations(ChatType.TIP_DM)and keepsSessionState.tipsUnreadCountcurrent.NavigationTrigger.Chat.ById) callschatCoordinator.refreshFeed(), which re-syncs the DB; Room re-emits andtipsUnreadCountupdates. So the data side already works.ScannerNavigationBarbuilt itsNavigationBarState(...)without passingtipsUnreadCount, soNavigationBarState.tipUnreadCountkept its default0. TheTipsnav button readsstate.tipUnreadCount→ always0→ the badge never appears or updates.Fix
Forward the count in
ScannerNavigationBar:Note the easy-to-miss naming mismatch:
SessionState.tipsUnreadCount(with ans) vsNavigationBarState.tipUnreadCount(nos).Result
The Tips tab badge now reflects unread tip conversations — updating on a tip push (via the existing feed refresh) as well as on cold start.
Testing
:apps:flipcash:features:scannercompiles clean.