Skip to content

fix(site/src/pages/UserSettingsPage/LinkedAccountsPage): keep polling for a new link after a failed fetch - #199

Merged
ibetitsmike merged 3 commits into
mainfrom
mike/plugins-followups-link-code-poll
Nov 11, 2026
Merged

ibetitsmike merged 3 commits into
mainfrom
mike/plugins-followups-link-code-poll

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

The Linked accounts page now keeps polling for a new link after a fetch fails.

While an unused link code is still valid, the page polls the linkable-plugins list, so a new link appears and the used code hides on its own. Before this change, refetchInterval returned false once state.error was set. The app's query client sets retry: false (site/src/App.tsx), so a single transient error stopped the polling. The page then kept showing the spent or expired code until the user left and returned to the tab, which triggers this query's focus refetch.

Now only an unused, unexpired code controls polling. A failed fetch shows the existing error alert above the cached list, and the next successful poll clears it.

Testing: the new Vitest case "keeps polling for the new link after a failed fetch" uses fake timers. It issues a code, makes one poll fail and checks that the next poll still runs. With the old !state.error && guard added back, that test fails, and the other three still pass:

× keeps polling for the new link after a failed fetch 139ms
FAIL   unit  src/pages/UserSettingsPage/LinkedAccountsPage/LinkedAccountsPage.test.tsx > LinkedAccountsPage > keeps polling for the new link after a failed fetch

With the fix restored, the file passes again (✓ ... LinkedAccountsPage.test.tsx (4 tests)). Biome, oxlint and tsc --noEmit pass.

Addresses the open review thread on #2 ("Keep polling through transient errors"). Part of #172.

Xum opened this PR on behalf of @ibetitsmike.

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T13:25:39.215589Z 3090505 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83630f386f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 3090505d02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike merged commit 58ebf1b into main Nov 11, 2026
9 checks passed
@ibetitsmike
ibetitsmike deleted the mike/plugins-followups-link-code-poll branch November 11, 2026 13:51
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum merged this PR on behalf of @ibetitsmike.

Merged as a squash of head c6a49b3256, right after #194, which produced 58ebf1b392.

  • CI: fork-ci run 43030571511 passed on the exact head, which contains main 0fc46ceeec. The only commit after that is chore(coderd/database): remove three unused forkdb queries #194 (forkdb queries), which shares no files with this site-only change. The lead merged main into the branch with update-branch; this PR's changed lines match 3090505d02 exactly.
  • Codex: clean receipt 6797048955 on 3090505d02, which has the same diff. 0 unresolved threads.
  • Validation: there was no UAT round. The change is a single refetchInterval condition, and the new Vitest case covers it. With the old !state.error guard restored, that case fails, and it passes with the fix.

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