Skip to content

fix(oauth): scope unauthorized_client as terminal to Atlassian refreshes - #8171

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/atlassian-terminal-refresh-scope
Sep 22, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/atlassian-terminal-refresh-scope

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • fix(oauth): treat unauthorized_client as a terminal refresh error #8167 made unauthorized_client a terminal refresh error for every provider. Only Atlassian uses it for a revoked or rotated-out refresh token; elsewhere it usually describes the app registration
  • Globally, that reached two places it should not: managed OAuth credentials (Microsoft, Salesforce, Dropbox, Zoom, Notion, HubSpot and others) would be persistently marked as needing reauthorization, and connectors on those credentials would be unscheduled with a reconnect prompt, all over one client configuration fault
  • Scopes the code to confluence and jira via a provider-specific set; isTerminalRefreshError takes an optional provider id, and the OAuth refresh path passes it. Managed OAuth adapters call without a provider and keep their previous classification (the managed Atlassian adapter already classifies it itself)

Type of Change

  • Bug fix

Testing

  • Unit tests: terminal for Confluence and Jira, not terminal for other providers or with no provider; refresh path asserts the provider is passed
  • Mutation-checked: dropping the provider argument, the provider map, or re-adding the code globally each fails a test
  • OAuth, managed OAuth and credential-group suites pass; type-check and check:audits pass

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 22, 2026 10:28pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or repository-rule issues identified.

Summary

This PR limits unauthorized_client terminal refresh handling to Atlassian providers while preserving globally terminal OAuth errors.

  • Passes the provider ID through the credential refresh path.
  • Classifies unauthorized_client as terminal only for Confluence and Jira.
  • Uses a ReadonlyMap to avoid inherited object-property matches.
  • Adds coverage for Atlassian, non-Atlassian, absent, and prototype-like provider IDs.

Reviews (2) · Last reviewed commit: "fix(oauth): look up provider terminal co..."

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/oauth/terminal-errors.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 87863dd into staging Sep 22, 2026
34 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/atlassian-terminal-refresh-scope branch September 23, 2026 00:05

This branch was previously deployed

1 inactive deployment
Preview — eb5892f8 Deployed Sep 22, 2026 by vercel[bot]
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