Skip to content

Refresh connection health after OAuth reconnect - #1545

Draft
RhysSullivan wants to merge 6 commits into
mainfrom
reconnect-health-refresh
Draft

Refresh connection health after OAuth reconnect#1545
RhysSullivan wants to merge 6 commits into
mainfrom
reconnect-health-refresh

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Reconnecting an OAuth connection left the stale health verdict (red dot + Expired badge) on screen until a hard page refresh, even though the backend already classified the re-minted grant as healthy.

Two structural causes, both fixed:

  • The server kept the pre-reconnect last_health when re-minting an OAuth connection. mintOAuthConnection now clears it: a re-mint replaces the grant, so any persisted verdict describes a credential that no longer exists.
  • The client's automatic revalidation was guarded once per mount, and a connection row never remounts on reconnect (its key is owner:integration:name). The guard is now once per persisted-verdict epoch (lastHealth.checkedAt), so the refetch after a reconnect (which now carries a cleared verdict) re-triggers the background probe and the dot recovers in place. Applies to both the detail-page row and the integrations-list summary.

New e2e scenario (was red before the fix, green after): seeds a DCR MCP OAuth connection against a provider whose grants are dead (expired tokens, refresh rejected as invalid_grant), restores the provider, completes Reconnect through the real popup, and asserts the row flips to Healthy with no reload. A token-endpoint gate in front of the OAuth test server provides the dead-then-alive provider, mirroring the revoke/restore pattern in health-checks-ui.test.ts.

Verified: new scenario + the other two in the file, health-checks-ui (10 scenarios), OAuth-adjacent selfhost scenarios, oauth-flow/connections unit tests, format, lint, typecheck.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing e7a3597 Commit Preview URL

Branch Preview URL
Aug 06 2026, 07:14 PM

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Console https://executor-preview-pr-1545.executor-e2e.workers.dev
MCP https://executor-preview-pr-1545.executor-e2e.workers.dev/mcp
Deployed commit e7a3597

Sign-in is Cloudflare Access (one-time PIN to an allowed email). The preview has its own database and encryption key; it is destroyed when this PR closes.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud e7a3597 Aug 06 2026, 07:15 PM

@pkg-pr-new

pkg-pr-new Bot commented Aug 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1545

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1545

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1545

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1545

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1545

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1545

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1545

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1545

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1545

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1545

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1545

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1545

executor

npm i https://pkg.pr.new/executor@1545

commit: e7a3597

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