GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(mobile): dismiss ended Live Activities on foreground by EMOEMOJAI · Pull Request #12656 · pingdotgg/t3code

Conversation

@EMOEMOJAI

@EMOEMOJAI EMOEMOJAI commented Sep 20, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What Changed

Dismiss ended T3 Code Live Activities when the iOS app refreshes its activity registration, before arming an activity for local work, and when signing out. The cleanup leaves active and stale activities available for their existing update-token registration.

Extend the existing expo-widgets patch with a factory-scoped native dismissal method. Await cleanup before discovering the current activity so a card created by another foreground path during that wait is reused. Cleanup errors are logged without preventing registration of the active card. Local arming captures the current registration generation and cancels if sign-out, account replacement, or provider teardown occurs while preferences or native cleanup are pending. A same-account token refresh still allows arming to finish.

Why

A reported iPhone showed a small “Agent work completed” card above the current aggregate card. The small card remained for more than five minutes and survived reopening T3 Code, while new updates continued to arrive on the large card.

expo-widgets only returns active/stale activities from getInstances(). Consequently, the existing duplicate-card cleanup cannot see an ended activity that iOS still displays on the Lock Screen. Expo documents this deliberate exclusion in expo/expo#48489. The native dismissal pass enumerates matching ended activities directly and ends them with immediate dismissal.

This change requires a new native iOS build; an OTA JavaScript update alone cannot add the native method. The failure-handling path keeps registration working when the native method is unavailable.

Validation

  • 50 tests pass in remoteRegistration.test.ts and liveActivityPreferences.test.ts.
  • The two new cleanup-order regression tests fail against the original registration implementation and pass with this change.
  • Six session-cancellation regression cases fail with the generation guards removed and pass with them restored; a seventh confirms same-account token refresh still permits arming.
  • Mobile TypeScript check and lint of the four changed TypeScript files pass.
  • Native iOS development-client build and installation pass with Xcode 27.0 (27A266a).
  • Simulator verification passes on iPhone 18 Pro / iOS 27.0: the original registration code leaves the completed card visible; the PR code dismisses it while preserving the active ActivityKit ID. A subsequent local content update succeeds and appears on the remaining card.

The change applies to iOS registration, foreground refresh, local arming, and activity shutdown. The non-iOS adapter supplies a no-op; no server, provider, or wire-contract changes are needed.

UI Changes

Verified with a temporary simulator fixture that creates real activities using the production T3 widget and invokes the production registration code. The before run uses remoteRegistration.ts from the PR parent; the after run uses the original fix commit 0b2006d. The subsequent session-cancellation guard is covered by the focused regression tests above; the native patch is unchanged. Both runs use the rebuilt native binary (the original JS does not call the new native cleanup method). No test-only code is committed.

Before: completed card remains alongside aggregate After: one aggregate, updated after cleanup
Before After

Videos: before clip, cleanup and successful update. Verification notes and fixture source are hosted as evidence assets on the contributor fork; no PR assets are committed.

The active ActivityKit ID is unchanged across both runs and after the successful update. Returning to the app exercises foreground registration without replacing the active card. The fixture uses a token provider returning null, so this verifies local ActivityKit cleanup and update continuity, not remote APNs delivery or cloud authentication.

The build used a temporary checkout without spaces because the existing Expo Widgets build script fails on the original Coding Projects path. CocoaPods 1.17.0 was installed as a prerequisite. No build workaround is included in this PR.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Model: GPT-6. Harness: Codex.

Summary by CodeRabbit

  • Bug Fixes
    • Ended Live Activities are automatically dismissed before activities are started, refreshed, or when signing out.
    • Prevents duplicate Live Activities during refreshes and concurrent updates.
    • Active Live Activity registration continues even if cleanup fails.
    • Pending activity setup is canceled when preferences are disabled or the session changes.
    • Live Activity presentation is improved across supported widget rendering modes and device capabilities.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@EMOEMOJAI
fix(mobile): dismiss ended Live Activities on foreground
0b2006d
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 20, 2026
@EMOEMOJAI
EMOEMOJAI marked this pull request as ready for review September 20, 2026 02:43
@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

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: Advanced

Run ID: d47a07ae-d773-4310-b36a-9a8d17dacb44

📥 Commits

Reviewing files that changed from the base of the PR and between 7445aa7 and 29f6998.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • apps/mobile/src/features/agent-awareness/agentLiveActivity.ios.ts
  • apps/mobile/src/features/agent-awareness/agentLiveActivity.ts
  • apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts
  • apps/mobile/src/features/agent-awareness/remoteRegistration.ts
  • patches/[email protected]

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change adds ended Live Activity dismissal to Expo Widgets and integrates cleanup into agent-awareness registration, local arming, and activity-ending flows. Tests cover ordering, failures, concurrent discovery, session changes, and token refresh.

Changes

Agent Live Activity cleanup

Layer / File(s) Summary
Native dismissal API
patches/[email protected]
Expo Widgets exposes dismissEndedInstances(), forwards it to iOS, dismisses ended activities on supported versions, and adds Live Activity environment fields.
Agent registration integration
apps/mobile/src/features/agent-awareness/agentLiveActivity.ios.ts, apps/mobile/src/features/agent-awareness/agentLiveActivity.ts, apps/mobile/src/features/agent-awareness/remoteRegistration.ts
Agent-awareness adds platform-specific dismissal helpers. Registration awaits cleanup before local arming and active reconciliation, checks registration generations, and logs cleanup failures without aborting.
Registration cleanup validation
apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts
Tests verify cleanup ordering, concurrent activity handling, failure recovery, session-change cancellation, and same-account token refresh behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Registration
  participant AgentLiveActivity
  participant NativeLiveActivity
  Registration->>AgentLiveActivity: dismissEndedAgentLiveActivities()
  AgentLiveActivity->>NativeLiveActivity: dismissEndedInstances()
  NativeLiveActivity-->>AgentLiveActivity: cleanup result
  AgentLiveActivity-->>Registration: Promise<void>
  Registration->>Registration: discover and register active activity
Loading

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 29f69

Provider remounts preserve the signed-in user’s Live Activity as intended, while sign-out still cleans it up. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: dismissing ended Live Activities during mobile foreground handling.
Description check ✅ Passed The description covers what changed, why it changed, validation results, UI evidence, native build requirements, and all checklist items. It is detailed and aligned with the pull request objectives.
Docstring Coverage ✅ Passed Docstring coverage is 92.86% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 4 files. (1 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

EMOEMOJAI added 4 commits September 20, 2026 11:01
@EMOEMOJAI
Merge remote-tracking branch 'origin/main' into fix/ios-dismiss-ended…
674b31e
…-live-activities
@EMOEMOJAI
fix(mobile): cancel live activity arming after session changes
c029353
@EMOEMOJAI
docs(mobile): document live activity cleanup and session lifecycle
aca8304
@EMOEMOJAI
docs(mobile): clarify live activity adapter contracts
29f6998
@EMOEMOJAI

EMOEMOJAI commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai resume

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@EMOEMOJAI

EMOEMOJAI commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge mentioned this pull request Sep 20, 2026
[Bug]: iOS Live Activity stays on Connecting because the relay throttles the running update #12668
Closed
2 tasks done
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 1, 2026 — with ChatGPT Codex Connector
@macroscopeapp

macroscopeapp Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This focused fix adds native iOS Live Activity dismissal and changes foreground/sign-out behavior across account-session transitions. Because those transitions govern account-associated lock-screen content, the change warrants human review despite its limited scope and added regression tests.

You can add or adjust custom eligibility rules. Learn more.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge

juliusmarminge commented Oct 3, 2026

Copy link
Copy Markdown
Member

Note

Grok responding on behalf of Julius.

Superseded by #15254, which landed the same fix in LiveActivityFactory.start() on the current [email protected] patch: dismiss this factory's ended activities before requesting a new card so an expired Lock Screen zombie no longer stacks beside the live one.

Closing this PR rather than merging — do not merge. Thanks for the earlier patch work on the older expo-widgets@57 tree.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge closed this Oct 3, 2026
This was referenced Oct 4, 2026
[Bug]: iOS Live Activity keeps showing "Done" after you open the finished thread #15728
Closed
[Bug]: An ended iOS Live Activity stays frozen on the Lock Screen when the app opens with no work running #16241
Closed
@only21mil only21mil mentioned this pull request Oct 18, 2026
fix(mobile): dismiss ended Live Activities when the app returns to the foreground #21307
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:L 100-499 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@EMOEMOJAI @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.