Skip to content

Resolves viewer identity for Jira, Linear and Trello - #5841

Open
sergiolms wants to merge 3 commits into
gitkraken:mainfrom
sergiolms:fix/issue-tracker-viewer-identity
Open

sergiolms wants to merge 3 commits into
gitkraken:mainfrom
sergiolms:fix/issue-tracker-viewer-identity

Conversation

@sergiolms

Copy link
Copy Markdown
Contributor

Description

Integration.getCurrentAccount() resolves the current user via the protected getProviderCurrentAccount hook, but that hook was only implemented for the git-hosting providers (GitHub, GitLab, Bitbucket, Azure DevOps). Jira, Linear and Trello had no way to answer "who is the current user", so a consumer reading issues from those trackers had no basis for viewer-relative flags (assigned-to-me, authored-by-me).

This adds getProviderCurrentAccount to all three:

  • Jira has no account-wide "who am I" endpoint, so it resolves the account against the first resource (site) the token can see.
  • Linear and Trello already have an account-wide user lookup that ignores the resource argument, so their per-resource and current-account paths now share one implementation.

listIssueTrackerIssuesPage also fires (without awaiting) integration.getCurrentAccount() once per read. PR and sweep reads already trigger it via getCurrentAccountId, but issue reads never did, so nothing populated the cache for any provider on that path.

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md) - N/A, no user-facing changelog entry for this internal package
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses - N/A, no pre-existing issue; happy to file one if preferred

@sergiolms
sergiolms requested a review from a team September 11, 2026 12:40
@augmentcode

augmentcode Bot commented Sep 11, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Resolves current viewer identity for Jira, Linear, and Trello integrations.

  • Jira now resolves the viewer through the first accessible Jira resource and memoizes it per access token.
  • Linear and Trello add account-wide current-account hooks backed by their existing viewer lookups.
  • The resource-specific and account-wide Linear/Trello paths now share a single account conversion implementation.
  • Issue-tracker page reads start a background current-account lookup to warm viewer-relative identity data.
  • The background request is intentionally isolated from the primary issue-read result path.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread packages/plus/integrations/src/reads/issueTracker.ts Outdated
getProviderCurrentAccount (the hook getCurrentAccount's cache relies on) was
only implemented for the git hosts and Azure DevOps, so consumers had no way
to know which issues in a Jira/Linear/Trello read belonged to the current
user even though the underlying issue fetch worked fine.

Jira resolves the account against its first visible resource (there's no
account-wide "who am I" endpoint there); Linear and Trello's own account
lookups already ignore the resource argument, so their per-resource and
current-account paths now share one implementation.

listIssueTrackerIssuesPage also fires (but doesn't await) getCurrentAccount
once per read: PR and sweep reads already trigger it via getCurrentAccountId,
but issue reads never did, so nothing populated the cache for any provider on
that path.
The background getCurrentAccount trigger ran before forceRefreshIfRequested,
so a forced sync could populate the account cache from the pre-refresh
session and spuriously record a stale-token failure.
listIssueTrackerIssuesPage's mapper reads getCurrentAccount's cache
synchronously right after the read call returns. A fire-and-forget call
races that read, so the first page's assignedToMe/authoredByMe can stay
unresolved with nothing to remap it later.
@sergiolms
sergiolms force-pushed the fix/issue-tracker-viewer-identity branch from c077b8d to 6277f04 Compare September 14, 2026 12:29
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