Skip to content

fix(mobile): A Live Activity the relay never registered no longer lingers out of date - #128

Draft
mwolson wants to merge 1 commit into
contrib/quiet-background-wakefrom
contrib/live-activity-unregistered-card
Draft

mwolson wants to merge 1 commit into
contrib/quiet-background-wakefrom
contrib/live-activity-unregistered-card

Conversation

@mwolson

@mwolson mwolson commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Problem

A Live Activity can end up on the phone and watch with no way to update or end it. A card started when the user sends a message from the phone gets one registration attempt, made right after the card is requested, when iOS has usually not issued its push token yet. That path schedules no retry. It relies on the token listener, which sits on a wrapper object nothing else references, and the native observer stops once that wrapper is collected. When the token never reaches the relay, the card stays at "Connecting", turns "Out of date" after ten minutes, and remains on the Lock Screen and watch for up to eight hours. Seen on 2026-11-13: a card showed one old thread as out of date for over an hour while the relay held no Live Activity token for the device and had two running threads to show.

Change

The wrapper that carries the token listener is kept for the life of the app process, so a late token still arrives. A card armed on send now schedules the same 15 second retry the foreground refresh uses when its first attempt does not register. A card this app started that the relay still has not accepted when the app goes to the background gets one more attempt, bounded to three seconds, and is then removed, so the Lock Screen shows no card instead of one nothing can correct. The removal is skipped when the app is already back in the foreground or another attempt registered the card in the meantime. The next foreground starts a fresh card from the relay's snapshot.

Scope and approval

Requested fork behavior, iOS only. Cards the relay has accepted, cards left from an earlier app process, and Android notifications are unchanged. A user who sends and leaves the app before iOS issues the token loses the card until the app is next opened.

Verification

Two tests in the registration module's test file: a card armed on send registers on the retry once its token exists and survives the app going to the background, and a card whose token never arrives is ended when the app goes to the background. Both fail with the production change reverted. Lint, both typechecks and the unused-code check pass. Not yet checked on a device.

@mwolson
mwolson added this pull request to stack #129 November 13, 2026 21:03
@mwolson
mwolson removed this pull request from stack #129 November 13, 2026 22:17
@mwolson
mwolson added this pull request to stack #131 November 13, 2026 22:17
@mwolson
mwolson removed this pull request from stack #131 November 15, 2026 20:21
@mwolson
mwolson force-pushed the contrib/live-activity-unregistered-card branch from f6d345f to e34ad15 Compare November 15, 2026 20:22
@mwolson
mwolson added this pull request to stack #132 November 15, 2026 20:22
@mwolson
mwolson removed this pull request from stack #132 November 15, 2026 22:41
@mwolson
mwolson changed the base branch from contrib/confirm-held-completions to contrib/quiet-background-wake November 15, 2026 22:41
@mwolson
mwolson force-pushed the contrib/live-activity-unregistered-card branch from e34ad15 to 1af4890 Compare November 15, 2026 22:42
@mwolson
mwolson added this pull request to stack #134 November 15, 2026 22:42
@mwolson
mwolson removed this pull request from stack #134 November 16, 2026 20:47
@mwolson
mwolson added this pull request to stack #136 November 16, 2026 20:47
@mwolson
mwolson removed this pull request from stack #136 November 16, 2026 23:02
@mwolson
mwolson added this pull request to stack #138 November 16, 2026 23:03
@mwolson
mwolson removed this pull request from stack #138 November 18, 2026 16:28
@mwolson
mwolson added this pull request to stack #142 November 18, 2026 16:28
@mwolson
mwolson removed this pull request from stack #142 November 19, 2026 19:30
@mwolson
mwolson added this pull request to stack #144 November 19, 2026 19:31
@mwolson
mwolson removed this pull request from stack #144 November 20, 2026 22:48
@mwolson
mwolson force-pushed the contrib/live-activity-unregistered-card branch from 1af4890 to 8793ffc Compare November 20, 2026 22:49
@mwolson
mwolson added this pull request to stack #145 November 20, 2026 22:50
@mwolson
mwolson removed this pull request from stack #145 November 21, 2026 02:41
@mwolson
mwolson added this pull request to stack #147 November 21, 2026 02:41
@mwolson
mwolson removed this pull request from stack #147 November 21, 2026 20:44
@mwolson
mwolson added this pull request to stack #150 November 21, 2026 20:46
@mwolson
mwolson removed this pull request from stack #150 November 21, 2026 21:02
@mwolson
mwolson added this pull request to stack #153 November 21, 2026 21:02
@mwolson
mwolson removed this pull request from stack #153 November 22, 2026 04:49
@mwolson
mwolson added this pull request to stack #155 November 22, 2026 04:50
@mwolson
mwolson removed this pull request from stack #155 November 23, 2026 15:21
@mwolson
mwolson added this pull request to stack #157 November 23, 2026 15:21
…gers out of date

A card started when the user sends from the phone got one registration
attempt, made before iOS had issued its push token, and no retry. The token
listener sat on a wrapper nothing referenced, so it could be collected before
the token arrived. The relay then had no token for the card and could neither
update nor end it, and it stayed on the Lock Screen and watch as "Out of date"
for hours. The listening wrapper is now kept, the first failed attempt
schedules the usual retry, and a card the relay still has not accepted when
the app goes to the background is removed.
@mwolson
mwolson removed this pull request from stack #157 November 23, 2026 19:20
@mwolson
mwolson force-pushed the contrib/live-activity-unregistered-card branch from 8793ffc to a6c84d0 Compare November 23, 2026 19:21
@mwolson
mwolson added this pull request to stack #159 November 23, 2026 19:22
@mwolson
mwolson removed this pull request from stack #159 November 24, 2026 17:26
@mwolson
mwolson added this pull request to stack #161 November 24, 2026 17:27

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.

1 participant