fix(ui): retry the prerequisite probe after a transient failure#20
Conversation
Code review (PR #19) caught that a transient prerequisite-probe failure wedged the shared singleton: probe()'s catch reset `check` to null but left `loading` holding the resolved promise, so load() no-op'd for the rest of the session — canEditHistory stayed true (history editing wrongly enabled) and the banner stayed hidden, with no retry path. - prerequisites.svelte.ts: reset `loading = null` in the catch so a later load()/refresh() actually re-probes. - PrereqBanner.svelte: re-probe on window focus when the probe hasn't succeeded (check === null), not only when a prerequisite is known-missing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
💡 Codex Reviewgit-it/src/lib/prerequisites.svelte.ts Lines 33 to 35 in f8a1f3d When the startup probe rejects, git-it/src/lib/github/activity.ts Lines 21 to 25 in f8a1f3d A backend ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Codex (PR #20 review) noted the first fix still left the destructive rewrite reachable: canEditHistory returned true whenever `check` was null, which includes a FAILED probe — so between a transient failure and a successful retry, "Rewrite history" ran on unverified prerequisites with no warning. Track the failure separately: a new `probeFailed` flag distinguishes "probe rejected" from "not probed yet". canEditHistory now allows only when a probe succeeded or hasn't run yet (optimistic pre-first-probe / non-Tauri), and stays DISABLED once a probe has failed until a later probe succeeds. Guard the probe with isTauri so the browser preview stays "unknown", not "failed". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codex (PR #20 review) flagged that isRetryableActivityError retried a RateLimited error, so fetchActivityWithRetry hit the same endpoint five times over ~6s — a rate limit won't clear inside that fixed backoff, and re-hitting it prolongs the throttle. Narrow the predicate to the transient cold-cache case only: retry `Other`/parse errors and non-GithubError blips; do NOT retry RateLimited, Forbidden, or the permanent kinds. Update the unit tests accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Both P2s addressed:
Gate: |
💡 Codex Reviewgit-it/src/lib/prerequisites.svelte.ts Lines 58 to 60 in d39fb48 When a focus event calls ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…e editing Codex (PR #20 re-review) flagged a race: refresh() (window-focus) can start a probe while another is still in flight, and both write check/probeFailed on completion. A newer success followed by an older failure completing late would clobber the good result and wrongly re-disable history editing until the next focus cycle. Add a monotonic probeSeq: each probe captures its id and commits its result only if it is still the latest, so superseded/out-of-order completions are dropped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Fixed in dc01bb6. Added a monotonic |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc01bb6b1e
ℹ️ 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".
Codex (PR #20 re-review) flagged that a still-pending initial probe left canEditHistory true (check null), so a slow probe let "Rewrite history" run before git/python3/filter-repo were verified — the probeFailed flag only covered the FAILED case, not the pending one. Make canEditHistory optimistic only in non-Tauri (browser preview): in the desktop app any non-success check (pending, failed, or unprobed) keeps editing DISABLED until a successful probe confirms availability. This subsumes the probeFailed flag, which is removed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses the P2 Codex flagged on #19 (the
next → mainpromotion): a transient prerequisite-probe failure permanently disabled the safety gate.Root cause: in the shared
prerequisitessingleton,probe()'s catch resetchecktonullbut leftloadingholding the resolved promise.load()is guarded byif (!loading), so it became a no-op for the rest of the session —canEditHistorystayedtrue(history editing wrongly enabled), the warning banner stayed hidden, and nothing re-probed (refresh()is only called from the focus handler, which itself guarded oncheck).Fix:
prerequisites.svelte.ts— resetloading = nullin the catch, so a laterload()/refresh()actually re-probes.PrereqBanner.svelte— broadened the focus-refresh guard fromcheck && !canEditHistoryto!check || !canEditHistory, so a failed probe (check === null) also retries on window focus.Once this merges to
next, #19 will include the fix.Testing:
npm run check0 errors ·npm test296 passed.🤖 Generated with Claude Code