fix(notifications): collapse per-peer message notifs instead of stacking#82
Closed
epicexcelsior wants to merge 1 commit into
Closed
fix(notifications): collapse per-peer message notifs instead of stacking#82epicexcelsior wants to merge 1 commit into
epicexcelsior wants to merge 1 commit into
Conversation
…ing (anonmesh#78) Background-delivered messages scheduled a fresh notification request per event, so iOS stacked one banner per message in the tray (same symptom as F9 — "push notifications spammed instead of updated"). Android was saved only by the channel-level group fallback. Pass a per-peer identifier (`anonmesh-msg-<srcHash>`) on scheduleNotificationAsync. On iOS this reuses the same UNNotificationRequest slot so a follow-up message replaces the unread banner instead of stacking; on Android same-identifier reuse updates the existing notification in place. Mirrors the single-id pattern already used by usePeerCountNotification. No new permissions or native config.
Collaborator
Author
|
Closing this in favor of a proper staging→v3 promotion PR. Team lead asked PRs to target The F9 fix is already on Future PR cadence:
|
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
Cherry-picks the F9 fix from
staging(originally PR #78, commit b5c81ff) ontov3. Same diff —+5lines inmobile_app/hooks/useMessageNotifications.ts.The staging branch has been mostly unused for ~17 PRs and the F9 fix has been stuck there. Bringing it directly to v3 so users actually receive it.
What it does
Background message notifications previously called
scheduleNotificationAsyncwith noidentifier. Each event minted a freshUNNotificationRequeston iOS — that's the team-lead-reported "push notifications spammed on iOS instead of updated."This passes a per-peer identifier (
anonmesh-msg-<srcHash>). iOS reuses the same request slot, so a follow-up message replaces the unread banner. Android same-identifier reuse updates in place.Mirrors
hooks/usePeerCountNotification.ts— same pattern, in production already.Scope
hooks/useMessageNotifications.ts— one new line on the schedule payload + a short commentVerified
npx expo run:android --device SeekerBUILD SUCCESSFUL, APK installed, app launches without notification-related errors in logcat.dumpsys notificationon Seeker confirmstag=anonmesh-peer-countexists — identical API surface this fix uses. The peer-count hook has shipped on iOS without spam complaints.Not yet verified (deferred to flip-ready)
Test plan (manual, 2 devices)
Background app, drive from a 2nd device:
onInApppath)Heads-up — unrelated pre-existing tsc error on v3
While running tsc, found that
v3head (currently31ad916) has a type error not introduced by this PR:The destructure on line 64 reads
{ beacons, beaconBroadcastRpc, status, peers }fromuseLxmfContext(), but lines 110/112 referencebeaconRpcWait. Looks like a merge-resolution artifact from #80/#81. Flagging here as informational — happy to open a separate small PR fixing the destructure if useful.