Skip to content

refactor(fe): share polled resource guard - #324

Merged
mergify[bot] merged 3 commits into
mainfrom
codex/state-3-polled-resource
Oct 4, 2026
Merged

mergify[bot] merged 3 commits into
mainfrom
codex/state-3-polled-resource

Conversation

@Cuarroc

@Cuarroc Cuarroc commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Der Konflikt von PR #324 mit main ist inhaltlich gelöst und der Merge-Commit e531a18 ist 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

  • Merged origin/main into codex/state-3-polled-resource.
  • Resolved the conflict in src/lib/useBoard.ts by retaining the shared polling guard and the onWorkerSeen callback, with both dependencies in the hook dependency list.
  • Conflict resolution was semantic only: it combined both parent behaviors and introduced no additional logic.

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 head e531a18358e2e4d52bc525bae4426d4aec7f875d.

NICHT ABGEDECKT

  • Linux does not compile or run the #[cfg(windows)] tests (run_in_pty, npm_shim, ConPTY, DPAPI) or the Windows clippy arms.
  • The Windows lane is covered by the merge-queue run.
  • External services (Updater-Endpoint, OmniRoute, Mirror) are not checked by prepush.

Review disposition

Review: ausstehend (Stufe B); the orchestrator will schedule the independent review.

Open points

  • Await independent review and the Windows merge-queue verdict.

Cuarroc and others added 3 commits October 4, 2026 18:01
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>
@Cuarroc
Cuarroc marked this pull request as ready for review October 4, 2026 16:24
@Cuarroc

Cuarroc commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T16:30:10.117974Z e531a18 Draft marked ready
ℹ️ 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.

@mergify mergify Bot added the queued label Oct 4, 2026

@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: 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 () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread src/lib/useQuestions.ts
Comment on lines +82 to +83
const request = beginRequest(replace);
if (request === null) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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;
},
};
}, []);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@mergify
mergify Bot merged commit 4d6f678 into main Oct 4, 2026
15 checks passed
@mergify

mergify Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

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

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