Skip to content

fix(site): set external auth provider polling status individually#26313

Open
aqandrew wants to merge 9 commits into
mainfrom
aqandrew/fix-multiple-external-auth-refresh
Open

fix(site): set external auth provider polling status individually#26313
aqandrew wants to merge 9 commits into
mainfrom
aqandrew/fix-multiple-external-auth-refresh

Conversation

@aqandrew

@aqandrew aqandrew commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

fixes #22420
ref DEVEX-369
ref DEVEX-269

The bug on CreateWorkspacePage, where clicking one external auth provider login button disabled all providers' login buttons, was caused by providers all sharing a single polling status ("idle" | "polling" | "abandoned") in the useExternalAuth hook.

changes

  • Instead of setting one status across all providers, the polling status in useExternalAuth is now tracked for each provider in a record whose keys are the providers' IDs.
  • The biggest diff is a new Storybook file CreateWorkspacePage.stories.tsx which reproduces the bug behavior from the issue.
    • Until now we've only had CreateWorkspacePageView.stories.tsx, which isn't able to model the user interactions needed to verify the bugfix. This file is unchanged.
  • Also deletes CreateWorkspacePage's useExternalAuth hook in favor of the global useExternalAuth hook (see refactor(site): use global useExternalAuth hook for CreateWorkspacePage #26310)

(co-written with Coder Agents)

aqandrew added 5 commits June 10, 2026 21:47
…der external auth

Adds CreateWorkspacePage.stories.tsx with four stories covering the
multi-provider external auth bug described in #22420:

- MultipleExternalAuth: both buttons render enabled
- ClickingOneAuthDoesNotDisableOthers: regression test for #22420
- OneProviderAuthenticated: mixed authenticated/unauthenticated state
- SequentialAuthFlow: full polling flow with mockResolvedValueOnce
The external auth polling state was a single shared value for all
providers. Clicking one provider's Login button set the global state to
"polling", which disabled every other provider's button. Users had to
refresh the page between each authentication.

Change the state from a single ExternalAuthPollingState string to a
Record<string, ExternalAuthPollingState> keyed by provider ID. Each
provider now independently tracks idle, polling, and abandoned states.
The query refetchInterval activates when any provider is polling and
each provider has its own 60-second timeout.

Fixes #22420
@linear-code

linear-code Bot commented Jun 11, 2026

Copy link
Copy Markdown

DEVEX-369

DEVEX-269

Comment on lines +439 to +440
const { startPollingExternalAuth, externalAuthPollingState } =
useExternalAuth(versionId);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Coder Agents noted that the #22420 bug is also present in TaskPrompt, which also calls useExternalAuth to render multiple "connect to external auth" buttons as siblings.

Should we add a new story for TaskPrompt which shows multiple missing auth providers and also verifies them working independently in a play function?

@aqandrew aqandrew requested review from aslilac and jaaydenh June 11, 2026 23:20
@aqandrew aqandrew marked this pull request as ready for review June 11, 2026 23:20
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.

Bug: Clicking one external auth button disables all other auth buttons on workspace creation page

1 participant