Repository navigation
phone push: an iPhone's icon count follows reads on any device, instead of staying until the app opens - #480
Merged
Conversation
…push that carries only the count An iPhone changes its app icon's count only when a push says so, and a read on another device sent nothing to iPhones (only Android apps that draw their own notifications heard of it). The icon kept the count of the last notification, 12 with nothing unread, until the app was opened. A read now sends each iPhone whose count changed one APNs push with only the badge (no alert, no sound, priority 5), coalesced over a second. A server with no APNs keys sends it through the push relay only when the relay's GET /v1/push says badges: true, since an older relay would show it as a "New message" alert; the relay draws a message of kind badge as the count alone, APNs only.
… and the guest skill card test stages four kinds of work bacb532 left two tests red on dev. Its new skill_manage description dropped the word reusable, so find_tool ranked skills_list first for "save this procedure as a reusable skill"; the description says reusable SKILL.md again (a skill is recurring work, which that change keeps). Its duplicate check turns away a create that covers an existing skill, and the guest skill card test staged four skills with one description, the same as an earlier test's: each now has its own kind of work. (cherry picked from commit 78889fc)
…list's two retries Fifteen tests failed in CI on Dec 1 in runs of main, a release and PRs DuskBotAI#477-DuskBotAI#483 whose changes do not reach them, a different set each run, and pass locally. Each entry names the runs it failed in. vps-routing's 'reuses the existing VPS with $settings' failed too (PR DuskBotAI#477, run 46623618361) but is left out: its name is made per case, and the list matches names written in the file. (cherry picked from commit 54f5c51)
…s 60 servers link from their own addresses Every link chaos run since the per-address limit on new links (adc99d7, Nov 14) was cancelled at CI's 60-minute limit, on main pushes, the weekly run and every PR that touches the link service: the scenarios finished in about five minutes and printed their table, but a socket or timer a scenario left open held the process. The run now exits once its results are written. The storm's 60 servers set up their links over one connection, so the node's front gave them one address, which the limit refused after 30 (Too many new links from here); each now uses its own connection, as 60 machines would. Locally, --quick passes all 12 scenarios and exits in 5.6 minutes. (cherry picked from commit 83ab615)
…y list's retries chat-mcp-tools' shutdown verdict, memory-order and the encrypted workspace restore failed in PR DuskBotAI#479's run 46740020170, whose change does not reach them, and pass locally. (cherry picked from commit c47197f)
…os job installs no packages The job runs `node apps/link-service/chaos/run.mjs` straight after checkout, so the undici import failed with ERR_MODULE_NOT_FOUND before any scenario ran.
…ds nothing for 8 s, as the app does src/lib/live-events.ts gives up on a dial that sends nothing in LIVE_EVENTS_OPEN_MS (8 s) and dials again. The probe dropped a quiet stream only after it had sent something, so one silent dial after node-5xx's 502s held it down until the relay closed it, about 90 s, and failed the scenario in CI on five of seven runs.
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.
What and why
An iPhone's app icon kept its count (12 in the report) after every chat was read on the desktop. An iPhone changes its icon count only when a push carries a
badge. A read on another device cleared notifications only on Android phones whose app draws its own (clearElsewhereinserver/mobile/link.ts), so an iPhone kept the count from its last alert until the app opened.After a read, within 1 s (
BADGE_SYNC_MS, so one "mark all read" sends one push), each iPhone whose count changed now gets a badge-only push:{ aps: { badge } }, no alert, no sound, priority 5.GET /v1/pushanswersbadges: true(rechecked every 30 min). A relay running today's code would show a badge message as a "New message" alert.kind: "badge"for APNs only, and only with a count.Deploy note
Servers that push through the relay get badge updates only after the relay with this change is deployed. Until then those servers skip the updates, and the icon behaves as it does today.
"New message" pushes
The APNs alert body is "New message" by design (
docs/phone-push.md). The notification extension replaces it with the bot's sealed text. On the server and in the extension's Swift code, that text opens correctly. Seen on a device, "New message" therefore points at the device side, which this PR does not change:How it was checked
server/mobile/link.test.ts: an iPhone shown 2 gets exactly one update to 0 after two reads in the same second, and none when the count did not change. It failed before the change.server/mobile/push.test.ts:{ aps: { badge: 0 } }.badges: truegets no request; one with it gets the badge message.apps/link-service/test/push-relay.test.mjs: the badge-only body and its priority; a badge for FCM, or without a count, is refused.GET /v1/pushnow returnsbadges: true.pnpm typecheckandpnpm lintpass.server/mobile(127 tests), the relay tests and the CI source guards pass.pnpm typecheck,pnpm lintandpnpm testpass (typecheck, lint and the related tests pass; the wholepnpm testwas not run locally)Not covered: a real APNs delivery and a real iPhone.
This branch also carries the commits of #483: the fix for two tests red on
dev(thefind_toolranking and the guest skill card), the flaky-test retry list for tests that failed at random in CI on Dec 1, and the link chaos fix, so this PR's CI can pass. They drop out of the diff once #483 merges.