Skip to content

fix(ancs): treat an unflagged copy of an earlier session's notification as backlog - #348

Merged
zackb merged 2 commits into
zackb:mainfrom
fernando2393:pr/ancs-replayed-copies
Nov 24, 2026
Merged

zackb merged 2 commits into
zackb:mainfrom
fernando2393:pr/ancs-replayed-copies

Conversation

@fernando2393

Copy link
Copy Markdown
Contributor

Closes #346 (the in-session part), as suggested there.

Change

NotificationRegistry::store() already recognised a copy of a notification from an earlier session (same app, title, subtitle, body and Date) to keep the list free of duplicates. It now returns whether it replaced one, and handle_response marks that notification pre-existing before on_notification. The popup, the OTP publish and the Messages correlation all skip pre-existing notifications already, so main.cpp needs no change. No clock is involved.

Testing

  • New registry test: a copy from an earlier session reads as backlog, while a new notification from the same app and an identical twin within one session don't. Suite passes.
  • On my iPhone: after a restart, I toggled Bluetooth to start a second session. All 6 entries that came back unflagged (Ledger ×2, Zalando Lounge, WhatsApp, Whoop, Instagram) were caught, and none popped up.

Not covered, as discussed: the first session after the daemon starts, and apps that send no Date.

🤖 Generated with Claude Code

…on as backlog

iOS does not flag every entry it replays when a session starts: some come back
without PreExisting on every reconnect and popped up again each time.
NotificationRegistry::store() already recognised a copy from an earlier session
(same app, title, subtitle, body and Date) to keep the list free of duplicates.
It now reports that, and the client marks the notification pre-existing before
on_notification, so it neither pops up nor republishes an OTP. No clock is
involved, and a new notification never matches on both content and Date.

Not covered: the first session after the daemon starts, when the registry is
empty, and apps that send no Date.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve the conflict with the held-popup path: mark an unflagged replay
pre-existing before the hold check, so it is never held or popped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zackb
zackb merged commit b93a34b into zackb:main Nov 24, 2026
7 checks 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.

ANCS: some old notifications come back without PreExisting on every reconnect and pop up again

2 participants