Skip to content

feat(messages): announce messages missed while the phone was away - #324

Open
aashish-thapa wants to merge 2 commits into
zackb:mainfrom
aashish-thapa:feat/notify-missed-messages
Open

aashish-thapa wants to merge 2 commits into
zackb:mainfrom
aashish-thapa:feat/notify-missed-messages

Conversation

@aashish-thapa

@aashish-thapa aashish-thapa commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What

When the iPhone comes back into range, the messages that arrived while it was away now raise desktop popups, the way an iPad or Mac catches up after being offline. Before this they showed up in the Messages view silently: the first MAP listing after a session opens is flagged backfill, and the daemon skipped popups for all of it.

That flag was there to keep a first sync from popping up the whole inbox. Now that history persists in the journal, a reconnect's backfill is usually just what you missed, so this change tells the two cases apart instead of silencing both.

  • Only new, unread messages. It announces messages newer than the newest one the daemon already held, and only ones still unread on the phone. Anything you read on the phone while away stays quiet.
  • No history, no popups. On a first sync, or when the journal couldn't be read (locked keyring), nothing tells new from old, so nothing is announced. Same as today.
  • A few vs. many. Up to three get their own popup with the normal reply action. More become one summary, e.g. "7 new messages" / "Mom, Alex, Hiking and 2 others".
  • Same rules as live popups. Hidden threads, hide_unknown_senders, the global popup switch and previews all apply.
  • No "Copy Code" action. A code that arrived while the phone was away has most likely expired, which matches the existing backfill OTP behavior.
  • Setting. Show messages missed while away, on by default, under Desktop popups in GTK and TUI. It is disabled along with popups.

How

  • ConnectionManager::set_backfill_handler: after a backfill listing that added anything, the connection manager passes the new messages as one batch, plus newest_known (the newest timestamp the store held before the listing, empty if none). Per-message MessageFn delivery is unchanged, so the UI still gets every bt_message.
  • tether/bluetooth/catch_up.hpp: plan_catch_up() is a pure function that drops anything not newer than newest_known, then returns either CatchUpEach (oldest first, so the newest ends up on top) or CatchUpSummary (count plus the newest message of each conversation). Unit tested in test_catch_up.cpp.
  • src/daemon/message_popups.cpp: the "does this message get a popup, and what does it look like" logic moves out of main.cpp unchanged, so live messages and the catch-up batch share one copy of it.
  • MessageStore::newest_timestamp() gives the baseline.
  • missed_message_popups in the config and in bt_status, plus the set_missed_message_popups command, documented in docs/PROTOCOL.md.
  • po/tether.pot regenerated. The five new strings are filled into all 15 catalogs, with each language's plural forms, so i18n.yml stays green. Like the rest of the catalogs these are machine-assisted drafts.

Testing

  • ctest: 649/649 pass, including the new CatchUp.* and MessageStore.ReportsTheNewestTimestampHeld tests, po_template and po_catalogs.
  • po/update-pot.sh --check and po/check-catalogs.sh pass.
  • Built on Arch Linux (Release).
  • Not yet run end to end against an iPhone; I will update this with a disconnect → text → reconnect run.

🤖 Generated with Claude Code

aashish-thapa and others added 2 commits November 15, 2026 17:23
When a MAP session opens, the first listing brings in what arrived while the
iPhone was disconnected. Those messages reached the Messages view but never
raised a desktop popup, so a phone that came back into range caught up
silently, unlike an iPad or Mac.

The connection manager now hands the backfill to the daemon as one batch,
along with the newest timestamp it held before the listing. The daemon
announces the messages that are newer than that and still unread on the
phone: up to three get a popup each, and more become one summary naming
the conversations. With no history held (a first sync, or a journal that
could not be read) nothing is announced, since nothing tells new from old.

Batched popups go through the same rules as live ones (hidden threads,
unknown senders, reply eligibility), which move out of main.cpp into
message_popups.cpp so both paths share them. Codes are not offered: one
that arrived while away has likely expired.

On by default, behind a "Show messages missed while away" switch in the
GTK and TUI settings (set_missed_message_popups).

This branch has not been deployed

No deployments
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.

2 participants