feat(push): Live Activity remote refresh (ActivityKit over APNs)#132
Merged
Conversation
Keeps a pinned agent's Live Activity fresh while the app is backgrounded:
- iOS: LiveActivityController requests a push token (pushType: .token) and
forwards each token to POST /api/push/live-activity {sessionId, token}.
- Backend: a per-session LA-token store; sendLiveActivityUpdate pushes over
APNs with push-type "liveactivity" + topic "<bundle>.push-type.liveactivity"
and an aps {timestamp, event, content-state} payload (mirroring the app's
ContentState/detail). PushBridge refreshes the activity on each agent update
(throttled) and sends event:"end" + clears the token on done/error.
Reuses the APNs token-auth JWT/HTTP2 path from the alert sender.
Like APNs alerts, this is inert without an Apple push key (LISA_APNS_*).
Verified: typecheck + build clean; npm test -> 823 pass / 1 skip (+5 LA tests:
content-state mapping, payload, liveactivity headers, store, PushBridge
update→end); ./build.sh -> iOS BUILD SUCCEEDED.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Keeps a pinned agent's Live Activity fresh while backgrounded via ActivityKit remote push — the last iOS-native differentiator, brought to the same "ready, needs an Apple key" bar as the APNs alert path. Based on
main(everything else already merged).What
LiveActivityControllerstarts the activity withpushType: .token, observespushTokenUpdates, and forwards each token toPOST /api/push/live-activity {sessionId, token}.sendLiveActivityUpdatepushes over APNs with push-typeliveactivity, topic<bundle>.push-type.liveactivity, and anaps {timestamp, event, content-state}payload mirroring the app'sContentState/detail().PushBridgerefreshes the activity on each agent update (3s-throttled) and sendsevent:"end"+ clears the token on done/error. Reuses the APNs token-auth JWT/HTTP2 path.Verification
npm run typecheck && npm run build && npm test→ 823 pass / 1 skip (+5 LA tests: content-state mapping, payload shape,liveactivityheaders/topic, store register/replace/unregister, and the PushBridge update→end+clear flow)../build.sh→ iOS BUILD SUCCEEDED.Honest limit
Inert without an Apple push key (
LISA_APNS_*) — live ActivityKit delivery can't be exercised here (no key, no device), so this is unit-/compile-verified, like the APNs alerts. ntfy remains the zero-Apple-infra path.🤖 Generated with Claude Code