You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(mobile): keep tracker setup tied to the confirmed host - #52846
When you connect Jira or Linear from your phone, the token is saved on one specific computer. If your phone switched computers or the desktop changed which server saves tracker accounts while the setup form was open, the form could stay open with your typed token and silently send it to the new computer on a second tap. Now setup stays locked to the original computer. If the destination changes, the phone discards the stale draft, closes setup, and asks you to open it again to confirm the new computer.
Files
Added
Deleted
Net
Test
2
$\color{#1a7f37}{\Huge{\mathbf{+}}}$432
$\color{#cf222e}{\Huge{\mathbf{−}}}$34
$\color{#1a7f37}{\Huge{\mathbf{+}}}$398
Prod
21
$\color{#1a7f37}{\Huge{\mathbf{+}}}$277
$\color{#cf222e}{\Huge{\mathbf{−}}}$60
$\color{#1a7f37}{\Huge{\mathbf{+}}}$217
What Changed
Before:
trackerAccountWriteClient overwrote binding.current with the new destination after a mismatch refusal while keeping the setup sheet open with the user's draft and no visible new destination, so tapping Connect a second time sent the credentials to the new host.
TrackerAccountBinding did not record the paired desktop hostId, so switching between two paired desktops that both reported local (or both predated trackerAccountHost) matched as the same destination.
clientOnHost(...) ?? client fell back to an untagged desktop call when relay capability was missing for a runtime: tracker host.
useMobileTasksRuntimeHydration closed showLinearConnect on disconnect, host change, or unsupported host, but left showJiraConnect open, and MobileTasksJiraConnectDrawer kept its draft while hidden or when kept hydration kept taskUiReady true across a host switch.
mobileTasksListShowsError hid the Tasks error banner when Jira was disconnected.
After:
trackerAccountWriteClient binds both the paired desktop hostId and the desktop's trackerAccountHost, never silently rebinds on mismatch or unconfirmed open, aborts if the binding was cleared or replaced mid-read, and fails closed instead of falling back to an untagged client when relay capability is absent.
Transient read failures keep the originally confirmed binding so retrying still only succeeds if that same original host answers.
When a paired-host context changes (hostId, client, disconnect, hydration failure, or unsupported host), both Jira and Linear setup sheets close, their bindings clear, their drafts discard, and in-flight requests are fenced by binding/attempt identity.
When the destination changes mid-setup (or setup opened without a confirmed destination), the sheet closes, discards the stale draft, clears the binding, and shows tasks.trackerAccount.destinationChanged (added across all 11 mobile locales) above the connect prompt so the user must reopen setup to confirm the new destination.
Why
Silent rebinding inside trackerAccountWriteClient broke the promise of #52704: a user responding to "try again" with the same draft could send credentials to a different host without ever seeing or confirming the change. Keeping the binding immutable for the open setup session and discarding stale form state closes the gap across Jira connect, Linear connect, and Linear workspace switching in one owner.
N/A. No new screens or layout changes. When a tracker destination changes mid-setup, the existing Jira or Linear sheet closes and the existing Tasks error banner displays the reopen-setup message.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
mobile/src/tasks/task-list/tracker-account-host.test.ts (9 tests): verifies paired-host mismatch refusal even when both desktops report local, repeated refusal without silent rebinding after tracker-host drift or unconfirmed open, explicit renewed binding after reopening, transient read failure keeping only the original host, fail-closed refusal without relay capability, in-flight binding clearing, older phone apps, and legacy desktops.
mobile/src/tasks/providers/jira/MobileTasksJiraConnectDrawer.test.tsx (3 tests): verifies immediate draft discard on paired-host switch even while taskUiReady stays true, closing and discarding stale form state with a reopen prompt when trackerAccountHost changes mid-setup, and ignoring late in-flight failures after a paired-host switch.
Ran pnpm --dir mobile typecheck, pnpm --dir mobile typecheck:tests, pnpm --dir mobile test src/tasks/task-list/tracker-account-host.test.ts src/tasks/providers/jira/MobileTasksJiraConnectDrawer.test.tsx, and pnpm check:changed (18/18 checks passed).
Performance
None, because the checks only run when opening or submitting tracker setup or changing paired-host context, with no new timers, polls, subscriptions, or extra RPC calls (mismatched paired hosts skip the verification settings.get read).
Risk
If a paired desktop changes its tracker host while the user is filling out Jira or Linear setup, the sheet now closes and clears the draft instead of allowing a second tap in the same sheet. That is the intended behavior so credentials never land on an unconfirmed computer. Older phone shells and legacy desktops keep their existing untagged path once paired host and destination are confirmed. A plain revert restores #52704's behavior.
Level: Low
AI Disclosure
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
No native store build is needed. Tasks is a host-served page.
Verified all 11 mobile locale catalogs contain tasks.trackerAccount.destinationChanged.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
After a paired-host or tracker-host change, trackerAccountWriteClient
silently rebound the open setup sheet to the new host on the first
refusal, and runtime hydration left the Jira setup drawer open with its
draft intact. Bindings now stay tied to the original paired host and
tracker destination, fail closed without silent rebinding or an untagged
relay fallback, and discard stale setup drafts when the host context or
destination changes.
Tracker account writes now validate the paired host and configured destination. Linear and Jira connection flows check for stale bindings and clients during asynchronous work. Setup state resets across hydration and drawer transitions, and the Jira drawer ignores stale results. The changes also update task-list error handling and add translations for changed destinations.
Merge Risk: Low · up to 477b7
The change keeps Jira and Linear setup tied to the destination the user confirmed, and the main safeguards look sound. One regression test for in-flight verification does not exercise the path it claims to cover, so a future change could remove the post-verification check without failing a test. Tightening that test is a small follow-up and does not block merging.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: tracker (Jira/Linear) setup on mobile is bound to the confirmed paired host, so a host change cannot silently redirect a credential draft. The changeset implements thi…
Description check
The description follows the repository template: ELI5, What Changed (before/after), Why, Linked Issue (STA-19948, follow-up to #52704), Visual Proof marked N/A with reason, Testing with named test fil…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: tracker (Jira/Linear) setup on mobile is bound to the confirmed paired host, so a host change cannot silently redirect a credential draft. The changeset implements this across the binding, write client, and setup drawers. The title uses the conventional fix(mobile) prefix and is concise, so it is a clear match for the primary change.
Full details: Description check
Explanation
The description follows the repository template: ELI5, What Changed (before/after), Why, Linked Issue (STA-19948, follow-up to #52704), Visual Proof marked N/A with reason, Testing with named test files and commands, Performance with a reason, Risk with level and revert guidance, and the checklist. Some template sections are left blank or unfilled: the Linked Issue line still reads as a reference rather than a 'Fixes #' issue link, the Review and AI Disclosure sections are empty, and the Level is given but the template placeholder text was replaced. These gaps are minor, so the description is mostly complete.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Maintainability & Code Quality · Quick win
Clear the binding only after verification reaches the paused read.
trackerAccountWriteClient awaits currentBinding.destination before it reads the tracker destination. This test clears binding.current before that continuation runs. The guard at tracker-account-host.ts:114-116 then throws changed, so readTrackerAccountDestination never starts and the paused settings.get is never reached. The test passes, but it would also pass if the post-verification guard at tracker-account-host.ts:121-123 were removed.
Wait until the paused settings.get has started. Then clear the binding and release the read. Have the fixture signal when settings.get pauses. This makes the test fail when the post-verification identity check is removed.
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
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.
ELI5
When you connect Jira or Linear from your phone, the token is saved on one specific computer. If your phone switched computers or the desktop changed which server saves tracker accounts while the setup form was open, the form could stay open with your typed token and silently send it to the new computer on a second tap. Now setup stays locked to the original computer. If the destination changes, the phone discards the stale draft, closes setup, and asks you to open it again to confirm the new computer.
What Changed
trackerAccountWriteClientoverwrotebinding.currentwith the new destination after a mismatch refusal while keeping the setup sheet open with the user's draft and no visible new destination, so tapping Connect a second time sent the credentials to the new host.TrackerAccountBindingdid not record the paired desktophostId, so switching between two paired desktops that both reportedlocal(or both predatedtrackerAccountHost) matched as the same destination.clientOnHost(...) ?? clientfell back to an untagged desktop call when relay capability was missing for aruntime:tracker host.useMobileTasksRuntimeHydrationclosedshowLinearConnecton disconnect, host change, or unsupported host, but leftshowJiraConnectopen, andMobileTasksJiraConnectDrawerkept its draft while hidden or when kept hydration kepttaskUiReadytrue across a host switch.mobileTasksListShowsErrorhid the Tasks error banner when Jira was disconnected.trackerAccountWriteClientbinds both the paired desktophostIdand the desktop'strackerAccountHost, never silently rebinds on mismatch or unconfirmed open, aborts if the binding was cleared or replaced mid-read, and fails closed instead of falling back to an untagged client when relay capability is absent.hostId,client, disconnect, hydration failure, or unsupported host), both Jira and Linear setup sheets close, their bindings clear, their drafts discard, and in-flight requests are fenced by binding/attempt identity.tasks.trackerAccount.destinationChanged(added across all 11 mobile locales) above the connect prompt so the user must reopen setup to confirm the new destination.Why
Silent rebinding inside
trackerAccountWriteClientbroke the promise of #52704: a user responding to "try again" with the same draft could send credentials to a different host without ever seeing or confirming the change. Keeping the binding immutable for the open setup session and discarding stale form state closes the gap across Jira connect, Linear connect, and Linear workspace switching in one owner.Linked Issue
STA-19948. Follow-up to #52704.
Visual Proof
N/A. No new screens or layout changes. When a tracker destination changes mid-setup, the existing Jira or Linear sheet closes and the existing Tasks error banner displays the reopen-setup message.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
mobile/src/tasks/task-list/tracker-account-host.test.ts(9 tests): verifies paired-host mismatch refusal even when both desktops reportlocal, repeated refusal without silent rebinding after tracker-host drift or unconfirmed open, explicit renewed binding after reopening, transient read failure keeping only the original host, fail-closed refusal without relay capability, in-flight binding clearing, older phone apps, and legacy desktops.mobile/src/tasks/providers/jira/MobileTasksJiraConnectDrawer.test.tsx(3 tests): verifies immediate draft discard on paired-host switch even whiletaskUiReadystays true, closing and discarding stale form state with a reopen prompt whentrackerAccountHostchanges mid-setup, and ignoring late in-flight failures after a paired-host switch.Ran
pnpm --dir mobile typecheck,pnpm --dir mobile typecheck:tests,pnpm --dir mobile test src/tasks/task-list/tracker-account-host.test.ts src/tasks/providers/jira/MobileTasksJiraConnectDrawer.test.tsx, andpnpm check:changed(18/18 checks passed).Performance
None, because the checks only run when opening or submitting tracker setup or changing paired-host context, with no new timers, polls, subscriptions, or extra RPC calls (mismatched paired hosts skip the verification
settings.getread).Risk
If a paired desktop changes its tracker host while the user is filling out Jira or Linear setup, the sheet now closes and clears the draft instead of allowing a second tap in the same sheet. That is the intended behavior so credentials never land on an unconfirmed computer. Older phone shells and legacy desktops keep their existing untagged path once paired host and destination are confirmed. A plain revert restores #52704's behavior.
Level: Low
AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
tasks.trackerAccount.destinationChanged.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)