fix(jira): show linked workspaces in Has Workspace by matching the Jira login, not its label (#29201)

* fix(jira): match workspace links by site identity, not account label

Jira links saved the account email as accountLabel while the Tasks page
source used the site display name, so sameSource() rejected every link and
the "Has Workspace" view stayed empty (STA-10654, #29055).

Jira connection identity is hostId + providerIdentity.siteId (per login per
site), so link matching, cmd-J workspace lookup and duplicate-link detection
now compare siteId for Jira and treat accountLabel as display-only. All Jira
label producers share getJiraAccountLabel so labels stay consistent.

* refactor(jira): simplify Has Workspace link matching after review

Match Jira workspace links by host only in sameSource, since siteId checks
downstream already separate logins; give getJiraAccountLabel a plain
structural parameter; make the other-login test use a reachable state.
This commit is contained in:
Jinwoo Hong
2026-10-15 16:30:34 -04:00
committed by GitHub
parent 3a3889c991
commit 2744bc7465
12 changed files with 114 additions and 36 deletions
+15
View File
@@ -142,6 +142,21 @@ export function areTaskSourceContextsEqual(
)
}
/** Jira identity is siteId (site + login); its label is display-only. Callers match providers first. */
export function haveConflictingTaskSourceAccounts(
a: Pick<TaskSourceContext, 'provider' | 'providerIdentity' | 'accountLabel'>,
b: Pick<TaskSourceContext, 'provider' | 'providerIdentity' | 'accountLabel'>
): boolean {
if (a.provider === 'jira') {
const left = a.providerIdentity?.provider === 'jira' ? a.providerIdentity.siteId : null
const right = b.providerIdentity?.provider === 'jira' ? b.providerIdentity.siteId : null
return Boolean(left && right && left !== right)
}
const left = a.accountLabel?.trim()
const right = b.accountLabel?.trim()
return Boolean(left && right && left !== right)
}
export function getTaskSourceRuntimeSettings(
context: Pick<TaskSourceContext, 'hostId'> | null | undefined
): Pick<GlobalSettings, 'activeRuntimeEnvironmentId'> {