Repository navigation
refactor(fe): share polled resource guard - #324
Conversation
Test-First: src/lib/useBoard.test.ts::does not starve a slow response behind overlapping polls Test-First: src/components/QueuePanel.switch.test.tsx::keeps the newer same-project poll when an older request lands last Regression-For: 740c4c1 Co-Authored-By: Codex (GPT-5) <noreply@openai.com>
Test-First: src/lib/useBoard.test.ts::does not starve a slow response behind overlapping polls Test-First: src/components/QueuePanel.switch.test.tsx::keeps the newer same-project poll when an older request lands last Regression-For: 740c4c1 Co-Authored-By: Codex (GPT-5) <noreply@openai.com>
|
@Mergifyio queue |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e531a18358
ℹ️ 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".
| vi.useRealTimers(); | ||
| }); | ||
|
|
||
| it("keeps the newer same-project poll when an older request lands last", async () => { |
There was a problem hiding this comment.
Preserve the regression tests in a red-first commit
This commit adds both regression tests together with the implementation, while its parent contains neither test, so there is no compiling, failing test commit before the fix. Put the failing tests in a predecessor commit and apply the polling fix afterward so the required red-first evidence remains reviewable.
AGENTS.md reference: AGENTS.md:L16-L18
Useful? React with 👍 / 👎.
| const request = beginRequest(replace); | ||
| if (request === null) return; |
There was a problem hiding this comment.
Force the null-answer refetch past the overlap guard
When answerQuestion returns null while a scheduled poll is pending, the required load(false) refetch is rejected here because it uses the default replace = false. Since null specifically means the closed row could not be decoded and must be refetched, the UI can keep showing the question as open—and allow another answer—until a later poll; make that answer-path load replace the pending request.
Useful? React with 👍 / 👎.
| if (pending.current === mine) pending.current = null; | ||
| }, | ||
| }; | ||
| }, []); |
There was a problem hiding this comment.
Bind request starters to the current resource key
Because this starter is stable across key changes, a callback from the previous project can run after the layout effect resets the generation but before its passive cleanup—for example, the old board status listener or polling interval. That callback can start an old-project request as the new current request, cause the new project's initial load to be rejected as overlapping, and then publish old cards or queue rows under the new project; make starters reject calls captured for an obsolete key/generation.
Useful? React with 👍 / 👎.
Merge Queue Status
This pull request spent 56 minutes 32 seconds in the queue, including 12 minutes 57 seconds running CI. Required conditions to merge
|
Der Konflikt von PR #324 mit
mainist inhaltlich gelöst und der Merge-Commite531a18ist gepusht.Die gemeinsame Polling-Guard-Logik und die
onWorkerSeen-Benachrichtigung bleiben im zusammengeführten Stand erhalten.Die lokale
prepush-Bahn ist grün; PR #324 ist für die Merge-Queue vorbereitet.Report
What changed
origin/mainintocodex/state-3-polled-resource.src/lib/useBoard.tsby retaining the shared polling guard and theonWorkerSeencallback, with both dependencies in the hook dependency list.Evidence
npm ci— exit 0.npx vitest run --no-coverage src/lib/useBoard.test.ts— exit 0 (3 tests passed).bash scripts/ci/red-first.sh— exit 0; the two referenced regression tests were red or missing at the merge base and green at the head.bash scripts/ci/gates.sh lane prepush— exit 0; frontend 468/468 passed, HQ 515/515 passed, Rust 1722/1722 passed with 7 skipped.git push -u origin codex/state-3-polled-resource— exit 0.git ls-remote origin refs/heads/codex/state-3-polled-resource— exit 0; remote heade531a18358e2e4d52bc525bae4426d4aec7f875d.NICHT ABGEDECKT
#[cfg(windows)]tests (run_in_pty, npm_shim, ConPTY, DPAPI) or the Windows clippy arms.prepush.Review disposition
Review: ausstehend (Stufe B); the orchestrator will schedule the independent review.
Open points