Repository navigation
fix(history): serialize message polling (INV-07) - #149
Merged
Merged
Conversation
Test-First: src/components/HistoryView.polling.test.tsx::keeps at most one message request in flight
Test-First: src/components/HistoryView.polling.test.tsx::keeps at most one message request in flight
Cuarroc
marked this pull request as ready for review
October 3, 2026 01:05
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. |
Contributor
|
Queued — the merge queue status continues in this comment ↓. |
Owner
Author
|
@Mergifyio queue |
This was referenced Oct 3, 2026
Contributor
Merge Queue Status
This pull request spent 43 minutes 9 seconds in the queue, including 10 minutes 12 seconds running CI. Required conditions to merge
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Der Nachrichtenverlauf startet bei einem langsamen Lesezugriff jetzt keine immer neuen Abfragen mehr.
Ein Regressionstest misst dafür über 30 Sekunden virtuelle Zeit höchstens eine offene Anfrage.
Die übrigen bestätigten Ressourcenrisiken sind unten als getrennte Folgepakete erfasst.
Report
What changed
src/components/HistoryView.tsx:32-48.Evidence
npx vitest run src/components/HistoryView.polling.test.tsxbefore the fix: exit 1; 30 seconds of virtual time produced 4 calls while the first promise was still pending.npx vitest run src/components/HistoryView.polling.test.tsxafter the fix: exit 0; the same measurement produced 1 call.npm run typecheck: exit 0.npm run lint: exit 0.bash scripts/ci/red-first.sh: exit 0; the test was absent at merge based738595and green at headb95f186.bash scripts/ci/gates.sh lane prepush: exit 0; 393 frontend tests, 502 HQ tests, and 1658 Rust tests passed, with 7 Rust tests skipped.bash scripts/ci/gates.sh lane prepush: exit 0.git ls-remote origin codex/inv-07-performance: exit 0; remote head equalsb95f1865add87bd49d8935b49ec8316a3a9b5390.NICHT ABGEDECKT
#[cfg(windows)]tests for run_in_pty, npm_shim, ConPTY, and DPAPI, nor the Windows-only clippy arms. The Windows lane runs in the merge queue.Review
Review: Stufe B abgeschlossen; Windows-Bahn läuft in der Merge-Queue.
Review disposition
Reviewer: Claude Sonnet 5.5 (Familie Claude, Autor: codex), Kandidat
b95f1865add87bd49d8935b49ec8316a3a9b5390, Diff 47 Zeilen, Gates CI grün (linux, red-first).src/components/HistoryView.tsx:32-48: a late response from worker A can still callsetMessagesafter switching to worker B (stale write). Rejected: pre-existing race, not introduced or worsened by this change; out of package scope. Follow-up candidate for the shared polling primitive.src/components/HistoryView.tsx:53-57: switching A→B→A while A's read is pending skips the new refresh and shows the empty state until the old read returns. Rejected: self-heals when the pending read resolves (bounded by the IPC time), cosmetic only.Bestandsaufnahme
src/lib/useQuestions.ts:84,127,131;src-tauri/src/store.rs:3924-3963: the five-second poll fetches every matching question without a SQL limit, then trims closed history to 50 only after DB, Rust, IPC, and React copies; proposed package: a seam-coordinated bounded open-plus-recent query.src/lib/useAttentionBlockers.ts:49,88: every 15 seconds a new O(worker count) readiness batch starts even when the previous batch is pending; proposed package: serialize or cancel batches and prove the request bound with fake timers.src-tauri/src/digest.rs:472-480;src-tauri/src/store.rs:1835-1851: a daily digest loads every message for every worker into one vector and sorts the complete set in memory, while the SQL query deliberately has no limit; proposed package: a seam-coordinated chunked or streaming digest read that preserves complete-day semantics.src/lib/useBoard.ts:93-100,src/components/UsageView.tsx:131-135,src/components/StatisticsView.tsx:127-133,src/components/ActivityView.tsx:158-161,src/components/InsightsView.tsx:79-83: independent interval pollers can overlap their own asynchronous reads; proposed package: a shared serialized polling primitive migrated in small frontend batches.src/lib/useBoard.ts:93-104: board status events already coexist with a five-second fallback poll; proposed package: one visibility-aware polling coordinator with event-triggered invalidation and backoff to reduce duplicate background reads.