garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /docs/notes/message-wake-ups.md

raw


topic: message-wake-ups triggers: [push.rs, simulator::push, wake_for_message, NOTICES_PREFIX, PLANS_PREFIX, PushReceiver.java, Push.java, sw.js, web-push.ts, systems::push, "Web Push", UnifiedPush, "New message"] updated: 2026-11-17

A closed app or page is woken for a private message

A private message or topic line for somebody with no chat device connected wakes their phone's app or their browser through the push channel that rings calls (calls.md, "Ringing a closed app"): the phone shows "New message", the browser the same, and opening it opens the chat. Built 2026-11-17.

What a push says

One word: which of the two it is. Never who wrote or in which chat — the server cannot read a sealed message anyway, and the push's carrier has no business knowing.

Only a device that can tell them apart

An app or page from before this shows every push as "Incoming call". So a message wakes only registrations that say they know better: a phone's address prefixed notices: (systems::push), a page's carrying its keys. A device that registers its address in the new form has the old form dropped (db::set_push_endpoint), or a call would wake it twice. No protocol revision: the marker rides in SetPushEndpoint's string, as webpush: does.

A third word, "plan" (a new notice near a followed place, plans.md), came on 2026-11-17 with protocol 50: an app that knows it registers its address as plans: instead of notices: (which it implies), and only those are woken for a plan. The client can use the new prefix unconditionally because a server speaks its protocol or refuses it. Browsers are not woken for plans.

Who is woken, and how often

Not done, and why

Unverified

The server half is tested with a database, the encryption against RFC 8291's example. Not seen on a device or in a real browser from this container: a real distributor's bytesMessage, the Android notice, and Chrome/Firefox decrypting the push and sw.js showing "New message". The check is a phone with ntfy and the app closed, and a browser with the chat tab closed, each sent a private message from another account.