Repository navigation
fix(tools): stop update loop on /tools (REGENGINE-1) - #3808
PetrefiedThunder wants to merge 1 commit into
Conversation
RecordsRequestChecklistClient.renderResults was calling setState during render (via FSMAToolShell), which re-rendered forever. Compute score on submit instead and add a data-free regression test. Fixes REGENGINE-1 Signed-off-by: Christopher <131207452+PetrefiedThunder@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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. |
PR Blocker ChecklistHead SHA: Status: Blocked (1 open blocker)Review Threads (1 unresolved)
Changes Requested (0)
Blocked Engines (0)
|
Findings
|
✅ Bundle Size Report
Bundle is within the 10.0MB limit. |
|
Vercel preview: https://regengine-f2hn5kyj3-petrefiedthunders-projects.vercel.app Access is via Vercel login (Deployment Protection). |
PetrefiedThunder
left a comment
There was a problem hiding this comment.
REVIEW: PASS deepseek 37f84e8
REGENGINE-1 update-loop fix verified on exact head.
- User-visible results unchanged —
renderResultsstill derivesscoreviacalcScore(answers)for StatTile "Self Reported Points"; grade was never shown in UI (only in submittoolInputs). Lead form still submits same shape (score,grade,answers) after compute moved intohandleLeadSubmit(RecordsRequestChecklistClient.tsx:153-175, :197-219, :284). - Render loop gone — removed
lastScore/lastAnswersstate and thesetLastScore/setLastAnswerscalls fromrenderResults. Remaining setters only run in submit handlers. Static scan: zeroset*calls insiderenderResults. - Regression test data-free — mocks
FSMAToolShellwithrenderResults({}); StrictMode render/rerender; throws on React console.error. No invented checklist answers/scores. - Local: vitest records-request-checklist 1/1 PASS;
tsc --noEmitclean.
Note (not a FAIL): PR Blocker Checklist currently Blocked by one unresolved CodeRabbit Trivial nit asking for a nonempty-answers submit payload test. That would require inventing sample answers; the intentional data-free regression covers the render-loop fix. Engine Review Pass fail is branch-prefix gate only (ignored).
Did not merge/arm/push.
Summary
Sentry REGENGINE-1 (
Maximum update depth exceededonregengine.co/tools, URL/tools/records-request-checklist, framerenderResults).Root cause
RecordsRequestChecklistClient.renderResultsinfrontend/src/app/tools/records-request-checklist/components/RecordsRequestChecklistClient.tsxwas called during render byFSMAToolShelland unconditionally calledsetLastScore/setLastAnswers. Each new state object scheduled another parent render → infinite update loop.Fix
Smallest change: remove the render-time setters and duplicated state; pass current answers into the lead-submit handler and compute score/grade there. Display and submission payload fields are unchanged.
Tests
frontend/src/__tests__/pages/records-request-checklist.test.tsx(Strict Mode render/rerender; throws on React console errors).npx tsc --noEmit: PASS.Review / merge
Reviewer: DeepSeek. Merge after the 11:30 AM PT re-arm, behind #3807.
Do not merge, arm, or enable auto-merge from this PR until the freeze lifts.
Note
Low Risk
Localized React lifecycle fix on one tool page; lead submission still sends the same score, grade, and answers computed at submit time.
Overview
Fixes REGENGINE-1 (
Maximum update depth exceededon/tools/records-request-checklist) by removing render-time state updates inRecordsRequestChecklistClient.renderResultsis invoked fromFSMAToolShellduring render; it previously calledsetLastScore/setLastAnswerson every pass, which re-rendered the parent in a loop.lastScoreandlastAnswersstate are dropped; the results view only derives display score fromanswers, and the lead form passesanswersintohandleLeadSubmit, where score/grade are computed forsubmitAssessment—same payload shape as before.Adds a Strict Mode regression test that mocks
FSMAToolShellto hit the results path with empty answers and asserts render/rerender without React console errors.Reviewed by Cursor Bugbot for commit 37f84e8. Bugbot is set up for automated code reviews on this repo. Configure here.