Repository navigation
Description
Operating system
macOS
Orca version
v1.4.75
Details
Summary
Orca's Jira task-provider stops working after a network path change (e.g. a daily corporate-VPN reconnect) and shows fetch failed. It does not self-heal — the only recovery is fully quitting and reopening Orca. The stored credential is valid the entire time; this is a transport/connection-pool bug, not an auth or credential issue.
Environment
- Orca desktop (macOS, Apple Silicon), app at
~/Applications/Orca.app. - Jira Cloud site over HTTP Basic auth (email + Atlassian API token).
- Corporate VPN that reconnects ~once per day (overnight / on sleep-wake).
Symptom / repro
- Configure (connect) Jira while the VPN is freshly up → works.
- ~A day later (after the VPN reconnects) the Jira panel fails with
fetch failed. - Re-entering the token does not reliably help; fully quitting and reopening Orca restores it (a fresh process = a fresh undici connection pool).
- Repeats on the next VPN reconnect.
Root cause (from reading the bundled out/main/index.js)
Jira requests use the bare global fetch() (undici) with a long-lived keep-alive pool and no Electron proxy/network integration:
requestWithCredentials→fetch(...)at index.js:75804jiraRequest→fetch(...)at index.js:75836
Every other network integration routes through electron.net.fetch after calling ensureElectronProxyFromEnvironment(...) — e.g. the Claude OAuth refresh at index.js:130105 / 130113 and index.js:131742. The Jira path does neither, so it:
- ignores the macOS system proxy (undici only reads
HTTP(S)_PROXYenv, which a GUI-launched app doesn't have), and - reuses dead keep-alive sockets after the network path changes (VPN reconnect) instead of re-establishing connections.
When the path changes, undici keeps trying the stale sockets and throws TypeError: fetch failed. Because token clearing is gated on isAuthError (status 401/403 only) at index.js:75973–75974, a transport error correctly does not delete the token — but there is also no retry/connection-reset/proxy-reprobe, so the integration stays broken until the process restarts and builds a new pool.
Secondary: testConnection (index.js:75945–75966) swallows errors without auth-aware handling, and Jira errors are written to console.warn/error (stderr) only — they never reach the structured trace log (main.trace.ndjson), so failures are invisible unless the app is launched from a terminal (which itself triggers the restart that masks the bug).
Suggested fix
- Route Jira requests through
electron.net.fetchand callensureElectronProxyFromEnvironment({ proxySession: session.defaultSession, probeUrl })before each request, mirroring the existing Claude OAuth path (index.js:130105). This gives Jira Chromium's proxy handling and graceful behavior across network changes.- Alternatively, if staying on undici: use a dedicated
Agent/dispatcher with a shortkeepAliveTimeout, retry once onUND_ERR_SOCKET/ECONNRESET/ETIMEDOUT, and recycle the dispatcher on apowerMonitorresumeevent.
- Alternatively, if staying on undici: use a dedicated
- Add the full error (
error.name,error.cause, resolvedsiteUrl) to the structured trace log, not just stderr, so transport failures are diagnosable without a terminal launch. - Give
testConnectionthe same auth-aware handling as the query functions — but only clear the token on a genuine 401/403, never on a transport error.
Impact
Every Orca user on a VPN/proxy that reconnects periodically loses Jira ~daily and must restart the app. The fix is low-risk (one network helper already exists in-tree and is used by other integrations).
Activity