Skip to content

fix(tips): show unread tip count on the scanner Tips tab badge - #1156

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/tips-tab-badge-not-updating
Jul 27, 2026
Merged

fix(tips): show unread tip count on the scanner Tips tab badge#1156
bmc08gt merged 1 commit into
code/cashfrom
fix/tips-tab-badge-not-updating

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

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:

  • RealSessionController observes chatCoordinator.observeUnreadConversations(ChatType.TIP_DM) and keeps SessionState.tipsUnreadCount current.
  • A tip push (NavigationTrigger.Chat.ById) calls chatCoordinator.refreshFeed(), which re-syncs the DB; Room re-emits and tipsUnreadCount updates. So the data side already works.
  • But ScannerNavigationBar built its NavigationBarState(...) without passing tipsUnreadCount, so NavigationBarState.tipUnreadCount kept its default 0. The Tips nav button reads state.tipUnreadCount → always 0 → the badge never appears or updates.

Fix

Forward the count in ScannerNavigationBar:

state = NavigationBarState(
    contactDmUnreadCount = state.contactDmUnreadCount,
    tipUnreadCount = state.tipsUnreadCount,   // ← added
    ...
)

Note the easy-to-miss naming mismatch: SessionState.tipsUnreadCount (with an s) vs NavigationBarState.tipUnreadCount (no s).

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:scanner compiles clean.
  • Manual: with unread tip DMs, the Tips tab shows the count; receiving a tip push while on the scanner bumps the badge.

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.)
@github-actions github-actions Bot added type: fix Bug fix area: scanner QR/Kikcode scanning, camera and removed type: fix Bug fix labels Jul 27, 2026
@bmc08gt bmc08gt self-assigned this Jul 27, 2026
@bmc08gt
bmc08gt merged commit e57b971 into code/cash Jul 27, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the fix/tips-tab-badge-not-updating branch July 27, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: scanner QR/Kikcode scanning, camera

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant