Skip to content

feat(mobile): connect Jira from the phone's Tasks tab with site, email and API token - #51202

Merged
AmoabaKelvin merged 5 commits into
mainfrom
mu-jira-connect
Nov 28, 2026
Merged

AmoabaKelvin merged 5 commits into
mainfrom
mu-jira-connect

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

On the phone, the Jira tab in Tasks only said "Connect Jira on your desktop". Now it has a Connect Jira button that opens a short form (site, email, API token), the same way Linear already works on the phone. If the token is wrong, the form shows the error Jira gave.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26
Prod 23 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​454 $\color{#cf222e}{\Huge{\mathbf{−}}}$​52 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​402

What Changed

  • Before: phones could read Jira issues, but jira.connect wasn't on the phone RPC allowlist, so Tasks could only send people to the desktop.
  • After: the Jira prompt offers Connect Jira when the host supports it. That opens a sheet with three fields (site URL, Atlassian email, API token), a link to create a token, and a note on where the token is stored. Connect sends jira.connect with Cloud auth. A failed connect keeps the sheet open with the host's message. On success the status refreshes and the issue list loads.
  • Host: jira.connect is allowlisted for phones on the tracker route (runtime-rpc-mobile-tracker-methods.ts), next to linear.connect. It's also in ACCOUNT_SETUP_METHODS, so an untagged call is always pinned to the desktop's tracker host and never falls back to this desktop when the relay is down. The host advertises jira.mobile-connect.v1. Phones talking to an older desktop keep the old "connect on your desktop" prompt.
  • Phone: the Linear account-host binding (linear-account-host.ts) is now tracker-account-host.ts. Jira setup binds to the desktop's tracker host when the sheet opens, as Linear does, so changing the default later can't send the token somewhere else. Normal Jira status reads stay untagged, so they follow the same host as the issue lists. Only the status read right after a connect uses the host the token went to.
  • Older server behind a newer desktop: an older server refuses the call with forbidden. Instead of that raw refusal, the sheet says the server needs an update and to connect Jira in Orca desktop.
  • New strings are added in all 11 phone locales.
  • Not included: self-hosted (Server/Data Center) Jira. Its PAT and Basic modes stay in desktop Settings.

Why

The phone allowlist was written when tracker credentials were desktop-only. That stopped being true once Linear's key form moved to the phone with account-setup host pinning. Jira was left behind, so the fix is to put jira.connect on the same route with the same pinning and reuse the same binding. A parallel Jira-only routing path would have meant a second copy.

The capability flag means an older desktop never shows a button that would fail. Keeping ordinary status reads untagged avoids a split where status reads one host and lists read another.

Linked Issue

No GitHub issue; this comes from the mobile parity work (phone users can't connect Jira, while Linear's key form works).

Visual Proof

iOS simulator (the 0.0.71 app), paired to a headless serve built from the worktree, with a local fake Jira Cloud site. Before = main; after = this branch.

Light Dark
Before: Jira tab (screenshot removed: contained real product data) (screenshot removed: contained real product data)
After: Jira tab (screenshot removed: contained real product data) (screenshot removed: contained real product data)
After: Connect Jira sheet (screenshot removed: contained real product data) (screenshot removed: contained real product data)
After: a bad token shows the host's error (screenshot removed: contained real product data)
After: connected, issues listed (screenshot removed: contained real product data) (screenshot removed: contained real product data)

Wire proof against the same serve, from a client speaking the phone's E2EE protocol as a paired mobile device:

capability jira.mobile-connect.v1 advertised: true
jira.status before                 → {"connected":false,...}
jira.disconnect (not allowlisted)  → {"code":"forbidden","message":"Method 'jira.disconnect' is not available to mobile clients"}
jira.connect with a bad token      → {"ok":false,"error":"Jira rejected the credential at 127.0.0.1:6795/rest/api/3/myself (HTTP 401). ..."}
jira.connect with the right token  → {"ok":true,"viewer":{"accountId":"acc-1","displayName":"Dev User",...}}
jira.status after                  → {"connected":true,"sites":[{...,"authType":"cloud"}],...}
jira.listIssues                    → ORC-12, ORC-11, ORC-9

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

  • runtime-rpc-mobile-tracker-methods.test.ts pins jira.connect, linear.connect and linear.selectWorkspace to the default server even when its relay is down, and checks that reads still fall back. With jira.connect removed from ACCOUNT_SETUP_METHODS, the Jira case fails.

  • I ran the wire proof above on macOS against a worktree-built headless serve: capability, a bad-token error, a successful connect, the status flip and the issue list.

  • pnpm check:changed passes, and so does the mobile typecheck.

  • iOS simulator: Jira tab before and after, the Connect Jira sheet, a bad token showing the host's error, and a successful connect listing issues, in light and dark.

Performance

None, because the new work happens only on an explicit Connect tap: one settings read when the sheet opens, then one jira.connect and one jira.status. Status refreshes send the same untagged jira.status as before. Nothing polls, no subscription is added, and when the sheet is closed it does no RPCs.

Risk

The riskiest part is where the token is stored. It's pinned to the desktop's tracker host, the same rule linear.connect uses, and a test covers that. A phone on an older desktop sees no change. A newer desktop whose tracker server is older shows an update message instead of a raw refusal.

The rename of linear-account-host.ts touches Linear setup's imports only. Its behavior is unchanged.

A plain revert backs this out. A Jira site connected from a phone stays saved on the host, as if it had been connected from desktop.

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 store build is needed. Tasks is a host-served page, so the sheet ships with the desktop.
  • Follow-up, not in this PR: the shared Jira request queue has no per-request deadline. That predates this change and phones already reach it through jira.issueComments and jira.getIssue.

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)

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The mobile Tasks flow now offers Jira account connection when the host advertises support. It collects a site URL, Atlassian email, and API token, then submits them through the Jira connection RPC. The flow displays connection errors and refreshes Jira status after success. Jira connection calls use default-server routing. Shared tracker-account binding helpers replace Linear-specific helpers in existing Linear flows. Localized prompts and form text were added across the listed locales.

Merge Risk: Low · up to 1c860

Connecting Jira from the phone works and is gated on the desktop's advertised capability. In a narrow case, a failed host lookup or a client replacement during setup, combined with a change of the desktop's default tracker host, could store the API token on a different desktop than the one the sheet was opened against. This is unlikely and low impact, and Linear setup has the same gap, so it is reasonable to merge with it tracked as follow-up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: adding Jira account connection to the phone's Tasks tab, using site URL, Atlassian email and API token. It is specific and matches the changeset, which adds a Connect …
Description check Passed The description follows the repository template and fills most required sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, and Checklist. It explains the before…
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.
Full details: Title check

Explanation

The title names the main change: adding Jira account connection to the phone's Tasks tab, using site URL, Atlassian email and API token. It is specific and matches the changeset, which adds a Connect Jira sheet and allowlists jira.connect for mobile.

Full details: Description check

Explanation

The description follows the repository template and fills most required sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, and Checklist. It explains the before/after behavior, the host-pinning mechanism, and the rollback. Gaps: the Linked Issue section has no issue number (it says none exists, and the template asks for one for outside contributors), the Risk Level is set to Low with no reasoning beyond the summary, and the AI Disclosure section is empty. The Review section is also empty.

Resolution

Optional improvements: add an issue reference or explain why none applies in the Linked Issue section, confirm whether AI Disclosure applies (the template only asks outside contributors to fill it), and fill in the empty Review section if the template requires it.

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

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 24b9d975-72b4-4700-a5bc-fb26d5f2e98c
Commits

Reviewing files that changed from the base of the PR and between b1e90c0 and 1c86036.

Files selected for processing: 11

  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
Files skipped from review as they are similar to previous changes: 11

  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Major · Do not submit the Jira token through an untagged client when the… · tracker-account-host.ts:22

mobile/src/tasks/task-list/tracker-account-host.ts:22
Major · Data Integrity & Integration · Quick win

Do not submit the Jira token through an untagged client when the setup-start settings read fails.

When settingsRead rejects, bindTrackerAccountClient returns the plain client. Its .catch(() => null) removes the tracker host. Later, connectJiraAccount submits jira.connect through that untagged client. The desktop routes untagged jira.connect calls to its current default host at request time. If the default changes after setup starts, the API token can be stored on a host the user did not choose. The desktop comment states that a typed API key must never be stored on another host.

Keep the host that setup binds. If the binding read fails, fail the Jira connect instead of falling back to an untagged client. Keep the current untagged behavior only when the desktop returns accepted settings without a trackerAccountHost field. The same fallback currently applies to reads that are not accepted. Decide how the Linear path handles a failed bind, because it shares this helper.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 62e58693-2b28-41cb-9233-8ce3f59ca78a
Commits

Reviewing files that changed from the base of the PR and between 787c8b0 and 80a3f70.

Files selected for processing: 24

  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/tasks/MobileTasksLegacySurface.tsx
  • mobile/src/tasks/providers/JiraConnectPrompt.tsx
  • mobile/src/tasks/providers/jira/MobileTasksJiraConnectDrawer.tsx
  • mobile/src/tasks/providers/jira/mobile-jira-operations.ts
  • mobile/src/tasks/screen-state/use-mobile-tasks-route-and-item-state.tsx
  • mobile/src/tasks/screen/mobile-tasks-filter-selection.ts
  • mobile/src/tasks/task-list/mobile-tasks-list-surface.tsx
  • mobile/src/tasks/task-list/tracker-account-host.ts
  • mobile/src/tasks/task-list/use-mobile-tasks-provider-load-actions.tsx
  • mobile/src/tasks/task-list/use-mobile-tasks-task-pagination-actions.tsx
  • src/main/runtime/rpc/server/runtime-rpc-mobile-tracker-methods.test.ts
  • src/main/runtime/rpc/server/runtime-rpc-mobile-tracker-methods.ts
  • src/shared/work-items/task-source-runtime-capabilities.ts

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f7199e38-bb9d-4093-9c27-bc47879f0065
Commits

Reviewing files that changed from the base of the PR and between 80a3f70 and b1e90c0.

Files selected for processing: 12

  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/tasks/task-list/use-mobile-tasks-provider-load-actions.tsx
Files skipped from review as they are similar to previous changes: 11

  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json

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

Phones could read Jira issues but jira.connect was not on the phone allowlist,
so Tasks told the user to connect Jira on the desktop. Phones may now call
jira.connect on the tracker route, bound to the desktop's tracker host as
Linear setup is, and the Jira tab opens a Connect Jira sheet (site, email,
API token) when the host advertises jira.mobile-connect.v1.
…ver's refusal

Ordinary Jira status reads follow the same host as the issue lists again; only
the read right after a connect uses the host the token went to. An older
runtime server that refuses jira.connect now gets an update-or-use-desktop
message instead of the raw refusal.
@AmoabaKelvin
AmoabaKelvin merged commit 7bf63e7 into main Nov 28, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant