Skip to content

fix(notifications): kill peer-count notif + quiet iOS banner updates#84

Merged
epicexcelsior merged 1 commit into
anonmesh:stagingfrom
epicexcelsior:epic/iou-notif-cleanup
May 19, 2026
Merged

fix(notifications): kill peer-count notif + quiet iOS banner updates#84
epicexcelsior merged 1 commit into
anonmesh:stagingfrom
epicexcelsior:epic/iou-notif-cleanup

Conversation

@epicexcelsior
Copy link
Copy Markdown
Collaborator

Summary

Two iOS-driven notification UX cleanups, observed on a real iOS device today.

Kills the peer-count notification entirely. `hooks/usePeerCountNotification.ts` showed a sticky tray entry with `X reachable · Y known`. Users don't act on mesh topology numbers. Sticky tray entry trains them to ignore notifications generally, which costs us when a real message lands. Mesh topology stays visible in NodesScreen and the wallet route pill.

Quiets iOS banner re-pop on message updates. F9 (#78) collapsed the tray entry per peer via identifier reuse — confirmed working on device. But Apple's documented behavior is: same-identifier requests replace the tray entry AND re-present the banner. So a chatty peer sending 5 messages popped 5 banners despite only one tray entry. Adds `interruptionLevel: 'passive'` so follow-up messages update the tray silently; first message from a peer still arrives loud.

Scope

  • `hooks/usePeerCountNotification.ts` — deleted (43 LOC)
  • `hooks/useMessageNotifications.ts` — adds `interruptionLevel: 'passive'` on schedule + removes the now-unused `peer-status` Android channel setup
  • `app/_layout.tsx` — removes hook import + invocation

Net: -54 LOC, +9 LOC.

Verified

  • tsc clean for touched files (`NetworkModeContext.tsx` pre-existing v3 error filtered, unrelated)
  • No remaining callers of `usePeerCountNotification`
  • Branched off `upstream/staging` per new staging-first policy

Test plan (manual on iOS + Android)

  • Cold launch on iOS — no peer-count notification appears in tray at all (peer count goes 0 → N during boot)
  • Cold launch on Android — same (no sticky entry)
  • Receive a message while app backgrounded — banner pops loudly (first arrival)
  • Receive a 2nd message from the same peer within ~30s — tray entry updates, NO banner re-pop (passive)
  • Receive a message from a different peer — separate banner pops (different identifier, fresh first-arrival)
  • Foreground in-app banner path unchanged

Rollback

`git revert` — three-file diff. No native config touched, no permissions changed.

@epicexcelsior epicexcelsior force-pushed the epic/iou-notif-cleanup branch from 2771d50 to 1553979 Compare May 19, 2026 10:40
…rruption

Message notifications (useMessageNotifications.ts):
  Lock screen / Notification Center now show generic content only —
  `title: 'anonmesh'`, `body: 'New message'`. No sender hash, no preview.
  In-app banner (when the app is foregrounded) still surfaces the sender,
  since the user is already inside the app. Combined with the per-peer
  identifier from anonmesh#78 and `interruptionLevel: 'passive'`, follow-up
  messages collapse silently into the existing tray entry instead of
  re-presenting the banner.

Peer-count notification (usePeerCountNotification.ts):
  Split by platform.
  - iOS: schedule ONCE on 0↔peers transition; body is generic 'Mesh active'.
    Notification Center has no silent persistent surface, so every
    reschedule resurfaces the entry. The in-app indicator carries live
    counts; the tray entry just signals "mesh is on".
  - Android: live counts on the LOW-importance 'peer-status' channel. The
    channel handles silence, so updates flow without re-presenting.

No native module changes, no permission changes — JS-only, ships via Metro
hot-reload or any existing dev build.
@epicexcelsior epicexcelsior force-pushed the epic/iou-notif-cleanup branch from 1553979 to 9d984e6 Compare May 19, 2026 10:49
@epicexcelsior epicexcelsior marked this pull request as ready for review May 19, 2026 11:05
@epicexcelsior epicexcelsior merged commit 1e7f5fb into anonmesh:staging May 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant