Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): an expired Live Activity no longer leaves a second card #15254

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/15254/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

iOS ends a Live Activity 8 hours after it starts but keeps the ended card on the Lock Screen for up to 4 more hours. expo-widgets' getInstances() only returns active and stale cards (expo/expo#48489), so our app thought no card was showing and started a fresh one. That left two cards stacked: a frozen "Agent status out of date" card and the live one.

The fix extends our existing expo-widgets@58.0.11 patch: LiveActivityFactory.start() now dismisses this factory's ended activities (end(nil, dismissalPolicy: .immediate)) before requesting a new one. Every way the app starts a card (sending from the phone, foreground priming, showcase) goes through start(), so this one change covers all of them. The relay and the widget layout are unchanged, and Android doesn't use this code.

Verification

iOS 27 simulator, T3 Code Dev built from this patch. I started card A and ended it with default dismissal, which leaves it ended but still on screen with getInstances() returning 0, like a card after the 8-hour limit. Then I started card B.

Before: card A has ended but is still on the Lock ScreenAfter: card B started, card A is gone
Before: ended card A still on the Lock ScreenAfter: only card B on the Lock Screen

In the liveactivitiesd log, card A sat ended ("zombie") for about 45 seconds, then was ended by our app and removed ("discarded") at the same moment card B started. I didn't wait for a real 8-hour expiry.

Shipping: this needs a store build, and OTAs won't know

Expo's fingerprint doesn't include our root patches/ directory. It only hashes apps/mobile/patches plus each package's package.json. This change leaves the production fingerprint unchanged (509325fd…, the same as iOS 2.0.0 build 104), so:

  • The Mobile Fingerprint Check won't add the 📱 Native Change label.
  • The production workflow will publish this merge's JS as an OTA to 2.0.0 binaries that don't contain the fix. The JS still works on them, so nothing breaks.
  • Users get the fix only from the next production store build. Under the current workflow that only happens after a version bump (or a manual dispatch).

Fixing fingerprint coverage of root patches is a separate change.

🤖 Generated with Claude Code, Claude Opus 5.5 in T3 Code


Devin Review
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. juliusmarminge added labelsmacroscope-review

    3. Approvability

      Verdict: Approved at 910c9b8

      Macroscope's review found this PR approvable — This is a focused iOS Live Activity bug fix that dismisses matching ended cards before starting a replacement, while the lockfile change only activates the updated dependency patch. The change is small, isolated, and has no product-default, schema, security, or deployment-infrastructure impact.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire4.9 KiB4.9 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.7 KiB3.7 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.1 KiB1.1 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.4 KiB20.4 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages110 (0.0%)8✅
      ClaudeTotal thread wire4.9 KiB4.9 KiB−41 B (−0.8%)6.8 KiB✅
      ClaudeThread snapshot wire3.7 KiB3.7 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB−41 B (−3.4%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded20.8 KiB20.7 KiB−41 B (−0.2%)29.3 KiB✅
      ClaudeLive turn messages21−1 (−50.0%)8✅

      Baseline: 65731f9 · PR result: 910c9b8 · Source CI: success

      Scenario and decoded snapshot size

      10 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.

      • Codex decoded thread snapshot: 106.1 KiB
      • Claude decoded thread snapshot: 106.4 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    5. Review in Change Stack →

      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
      • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Team
      • Run ID: 33faa98f-f698-4385-9841-8d0818a7e5f2
      📥 Commits

      Reviewing files that changed from the base of the PR and between 65731f986ba2175063b0182deb6a143f8f323b74 and 910c9b89bf5d34ce0336701aed0bd4fc53a612f6.

      ⛔ Files ignored due to path filters (1)
      • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing (1)
      • patches/expo-widgets@58.0.11.patch

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


      📝 Walkthrough

      Walkthrough

      The patch updates Live Activity environment properties and view construction, adds cleanup of matching ended activities before a new activity starts, and changes the layout-registry script’s direct-execution check to compare resolved paths.

      Changes

      Live Activity Updates

      Layer / File(s)Summary
      Live Activity environment and view rendering
      patches/expo-widgets@58.0.11.patch
      LiveActivityEnvironment adds optional widgetRenderingMode and isLiquidGlassAvailable properties. Live Activity views resolve nodes using their own rendering environments.
      Dismiss matching ended activities
      patches/expo-widgets@58.0.11.patch
      Before requesting a named activity, LiveActivityFactory schedules immediate dismissal of matching activities in the .ended state.

      Layout Registry Execution Check

      Layer / File(s)Summary
      Resolve paths for direct-execution check
      patches/expo-widgets@58.0.11.patch
      The layout-registry script compares resolved real paths in its direct-execution check.

      Priority: ➖ Normal

      Estimated code review effort: 2 (Simple) | ~15 minutes

      Change: Bug fix

      Merge Risk: 🔵 Low · up to 910c9

      Starting a replacement may briefly show two cards, but the old card should be removed. This is a bounded risk rather than a merge blocker.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Description check⚠️ WarningThe description explains the problem, the change, and focused verification. It does not include the required Scope and approval section or state that the focused fix qualifies without prior approval.Add a Scope and approval section. Link the triaged issue or maintainer approval, or explain why this is a small, focused fix of an obvious bug that does not need prior approval.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly describes the primary change: preventing an ended Live Activity from remaining alongside a newly started card.
      Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      • Fix all pre-merge checks with AI
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Comment `@coderabbitai help` to get the list of available commands.
    6. juliusmarminge merged this77823bd

    7. juliusmarminge closed this

Sign in to join this conversation.