Repository navigation
fix(relay): an iPad no longer gets a Done alert for every unrelated publish - #15015
juliusmarminge wants to merge 1 commit into
Conversation
…ublish Devices without a Live Activity token (iPads, iPhones with Live Activities off) fall back to regular push notifications. That fallback alerted on the first row of the user's aggregate rather than the thread being published. A finished thread stays at the top of the aggregate for two minutes, so every publish in that window re-sent its Done alert: one completion with six subagent tombstones produced 42 pushes in a minute. Push alerts now describe only the published thread's state, matching the Android path. The notification-only send folds into sendForTarget so one function decides whether an iOS device rings. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, self-contained relay bug fix that prevents unrelated Live Activity aggregate rows from producing duplicate iOS completion alerts while preserving existing preference, replay, Android, and card-delivery behavior. Focused tests cover the new state-based notification flow and duplicate-alert scenario. You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughAPNs notification selection now uses published thread state. AgentActivityPublisher sends the aggregate and, when notifications are enabled, the thread state through one APNs delivery call. Android delivery remains unchanged. ChangesState-Based APNs Delivery
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant AgentActivityPublisher
participant ApnsDeliveries
participant APNs job queue
AgentActivityPublisher->>ApnsDeliveries: sendForTarget with aggregate and optional thread state
ApnsDeliveries->>APNs job queue: enqueue eligible notification derived from thread state
Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change limits iOS alerts to the published thread's state and fixes repeated "Done" alerts on push-only devices. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Problem
iPads (and iPhones with Live Activities off) get regular push notifications instead of Live Activity updates. That fallback built its alert from the first row of the user's activity aggregate, not from the thread being published. A finished thread sits at the top of the aggregate for two minutes, so every publish in that window, including tombstones for its subagents and updates from unrelated threads, re-sent the same "Done" alert.
Production traces for one user show a single completion turning into 42 identical "Done" pushes in one minute on an iPad. That device has received 3,089 pushes since Sep 2.
Fix
notificationForState). A tombstone (state: null) or another thread's update can't re-ring a completion. Android already worked this way (FcmDeliveries.androidAlertForState).sendPushNotificationForTarget) folds intosendForTarget. One function now decides whether an iOS device rings. Links without notifications still update the card but pass no state, so they never alert.Live Activity alerts are unaffected. They already compare against the last delivered aggregate.
Verification
Not visual; the before/after evidence is a regression test.
alerts a push-only device once per completion, not per later publish: fails onmain(the 3 tombstone publishes each queue another "Done" push) and passes with this change (exactly one push).vp test run src/agentActivity/{ApnsDeliveries,AgentActivityPublisher,FcmDeliveries}.test.ts: 111 passed.vpr typecheck(relay): passed.vp lint/vp fmton changed files: clean.Needs a relay deploy to take effect. The server-side change that stops subagent tombstones from being published at all is a separate PR.
🤖 Generated with Claude Code
Model: Claude Opus 5.5 (1M context) · Harness: Claude Code in T3 Code