Repository navigation
fix(fe): drop stale replies in attention inbox and digest panel - #312
Conversation
Test-First: src/components/AttentionInbox.test.tsx::keeps the newer poll reply when an older one for the same project lands last Test-First: src/components/ActivityView.test.tsx::shows the newest digest page when an older page request resolves last Co-Authored-By: GPT-5 <noreply@openai.com>
Regression-For: de42c66 Co-Authored-By: GPT-5 <noreply@openai.com>
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: 740c4c1cd1
ℹ️ 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".
| const tokenRef = useRef(0); | ||
|
|
||
| const refreshRecos = useCallback(async () => { | ||
| const mine = ++tokenRef.current; |
There was a problem hiding this comment.
Avoid invalidating every slow poll response
When listRecommendations consistently takes longer than the 15-second interval, each timer tick increments this token before the preceding request completes, so every response is discarded at line 76 and the inbox can remain permanently empty or stale. This can occur during sustained backend or database latency; either avoid overlapping polls or track the newest successfully applied request rather than requiring the response to belong to the most recently started request.
Useful? React with 👍 / 👎.
|
Queued — the merge queue status continues in this comment ↓. |
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 11 minutes 41 seconds in the queue, including 11 minutes 20 seconds running CI. Required conditions to merge
|
Die Anzeige von Empfehlungen und Tages-Digests konnte von einer älteren, langsameren Antwort überschrieben werden. Jetzt zählt nur noch die jeweils neueste Anfrage, und nach dem Schließen der Ansicht schreibt nichts mehr. Das ist rein Oberfläche, es gibt keine Rust-Änderung.
Ersetzt #294 (Trailer-Form, red-first)
Report
What changed
AttentionInbox: replaced the project-only guard with a request token (tokenRef), bumped on every request and on effect cleanup (project switch / unmount). Older polls of the same project can no longer overwrite newer data.ActivityViewDigestPanel: separate tokens for the date list and the page request, bumped on project switch and unmount. The activity feed already had a token.Evidence (base
origin/main0c7b513ad79b800f5919370e0a2c3fcc1487f156, head740c4c1cd192e299a307b673ad70099a5ac4b11e, +124/-12 lines including tests)de42c66ae66d1b661e36333176909f083a73ca9efails exactly the two new race tests (npx vitest run src/components/AttentionInbox.test.tsx src/components/ActivityView.test.tsx, exit 1; 2 failed, 7 passed).bash scripts/ci/red-first.sh: exit 0 (log/tmp/fj4-r2-red-first.logon the server); both exact named tests are missing at the merge base and green at the head.bash scripts/ci/gates.sh lane prepush: exit 0 (log/tmp/fj4-r2-prepush.logon the server; frontend 463/463, HQ 510/510, Rust 1706/1706).git ls-remote origin refs/heads/claude/fj-4-request-token-r2: exit 0; remote SHA equals final SHA.NICHT ABGEDECKT
#[cfg(windows)]tests and Windows clippy arms (Windows lane runs in the merge queue).Review disposition
740c4c1cd192e299a307b673ad70099a5ac4b11e.src/components/AttentionInbox.tsx:69-80: accepted. Starting each 15-second poll invalidates every earlier reply, so responses that consistently take longer than the interval can never reach the UI. Countercheck confirmed that project-switch and unmount guards do not prevent this same-project starvation.bash scripts/ci/red-first.shexited 1 because the unpushed fix commit contains an invalidRegression-ForSHA. History rewriting is prohibited, so no review commit was pushed.