fix(ui): guard the repo-picker panels against out-of-order fetch responses - #7896
fix(ui): guard the repo-picker panels against out-of-order fetch responses#7896shin-core wants to merge 1 commit into
Conversation
…sponses Each of these panels binds a free-text owner/repo <input> to a load callback run in an effect keyed on repoFullName, with no cancellation guard: typing fires a fetch per keystroke, and an earlier (shorter, partially-typed) request resolving after a later one silently overwrites the newer repo's state -- e.g. showing the wrong repo's BYOK key status / AI-review mode. Apply the same cancelled-flag idiom use-polled-fetch.ts already uses (flag flipped in the effect cleanup, checked before any post-await setState) to all five load functions: activation-preview, ams-miner-cohort-card, ai-review-settings, and maintainer-settings (its main load plus FocusManifestEditor). Adds a representative regression test that resolves two repos' requests out of order and asserts the stale one is dropped.
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-21 16:35:38 UTC
Review summary Nits — 3 non-blocking
Flagged checks (non-blocking)
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
This pull request changes UI/visual code but its screenshot evidence is incomplete. Every required viewport × theme combination needs its own before/after image pair in a labeled table row (e.g. "Desktop · Light | before | after"). Still missing: Desktop · Dark, Tablet · Dark, Mobile · Dark. Please resubmit with the remaining rows filled in. See https://github.com/JSONbored/loopover/blob/main/.claude/skills/contributing-to-loopover/SKILL.md for the exact format and examples. This is an automated maintenance action. |


What & why
Closes #7784.
Four maintainer panels bind a free-text
owner/repo<input>to auseCallbackload run in auseEffectkeyed onrepoFullName, with no cancellation guard. Every keystroke past the first/is a valid repo and fires a new fetch; if an earlier (shorter, partially-typed) request resolves after a later one, its response silently overwrites the newer repo's state — e.g.ai-review-settingswould show the wrong repo's BYOK key status and AI-review mode after the user finished typing a different repo. Same bug class as the already-fixed AuditFeed out-of-order issue, triggered by keystrokes instead of pagination.The fix
Apply the existing cancelled-flag idiom from
use-polled-fetch.ts(the issue's required reuse pattern) to all five load functions — the flag is set in the effect cleanup and checked before any post-awaitsetState:Sites guarded:
activation-preview.tsx,ams-miner-cohort-card.tsx,ai-review-settings.tsx, andmaintainer-settings.tsx(its main load andFocusManifestEditor).maintainer-panel.tsx'srunPreviewis button-triggered, not auto-fetch-on-keystroke, so it's out of scope per the issue. No rendered output changes — this is a behavioral guard only.Tests
A representative regression test in
activation-preview.test.tsx: it issues two repos' requests, resolves the newer one first, then resolves the stale earlier one, and asserts the stale response is dropped (the newer repo's preview stays on screen). Verified bug-catching: removing the guard makes the stale "FIRST repo" data clobber the UI and the test fails.Validation
apps/loopover-ui:vitest run(touched components) pass;tsc --noEmitexit 0; eslint clean; Prettier clean.apps/loopover-uiis not under thesrc/**99% patch gate; the regression test is the coverage deliverable. Branched off currentmain, mergeable-clean.