Skip to content

fix(ui): drop stale repo-picker panel responses on keystroke races (#7784) - #7888

Closed
kai392 wants to merge 1 commit into
JSONbored:mainfrom
kai392:fix/7784-repo-picker-stale-response-guard
Closed

fix(ui): drop stale repo-picker panel responses on keystroke races (#7784)#7888
kai392 wants to merge 1 commit into
JSONbored:mainfrom
kai392:fix/7784-repo-picker-stale-response-guard

Conversation

@kai392

@kai392 kai392 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a cancelled-flag stale-response guard to the five free-text repoFullName/base load paths in AMS cohort, AI review settings, activation preview, maintainer settings, and focus-manifest editor so slower responses cannot overwrite newer keystrokes (4 repo-picker panels have no stale-response guard - free-text keystrokes race each other #7784).
  • Keep load callable for retry/refresh via optional { cancelled } opts; wrap onRetry/onRefresh so click events are not passed as opts.
  • Add a regression test that resolves an out-of-order first fetch after a second repo change and asserts the stale window is dropped.

Closes #7784

Test plan

  • npx prettier --write on touched files
  • npx eslint on touched files
  • npx vitest run src/components/site/app-panels/ams-miner-cohort-card.test.tsx (9 passed)
  • CI green on this tip (no follow-up pushes)

@kai392
kai392 requested a review from JSONbored as a code owner July 21, 2026 16:11
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-21 16:20:22 UTC

5 files · 1 AI reviewer · no blockers · readiness 98/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The AI review returned non-blocking notes for this change but did not include a separate narrative summary. Review the nits below before deciding this PR.

Nits — 4 non-blocking
  • The guard is intentionally bypassed for `onRetry`/`onRefresh` (`isCancelled` defaults to `() => false`), so two rapid manual retries could still race and let a stale retry response overwrite a newer one — out of scope for this fix but worth a one-line comment noting the tradeoff.
  • The identical `cancelled`-flag pattern is now copy-pasted into five call sites; consider extracting a small `useCancellableLoad`/`useStaleGuard` hook to avoid re-diverging this logic on the next touch of any of these panels.
  • `maintainer-settings.tsx` is now ~560 lines (flagged by the size check); the `FocusManifestEditor` sub-component (and its own `load`/guard) could be split into its own file now that it has independent load/guard logic.
  • Add at least one focused unit test per remaining panel (or a shared test helper) that resolves an out-of-order fetch to cover the newly-added `isCancelled()` branches in the other four files.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7784
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 39 registered-repo PR(s), 24 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kai392; Gittensor profile; 39 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Review context
  • Author: kai392
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, Kotlin, Perl, TypeScript, Vue
  • Official Gittensor activity: 39 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/ before / (scroll)
before / (scroll)
after / (scroll)
after / (scroll)

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.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 repo-picker panels have no stale-response guard - free-text keystrokes race each other

2 participants