Skip to content

Fix TypeError crash in GraphLaTeX renderer when nodes/links are missing - #173

Open
Trosper3 wants to merge 1 commit into
ReduxAPI_GUIfrom
fix/168-dfa-latex-graph-crash
Open

Fix TypeError crash in GraphLaTeX renderer when nodes/links are missing#173
Trosper3 wants to merge 1 commit into
ReduxAPI_GUIfrom
fix/168-dfa-latex-graph-crash

Conversation

@Trosper3

@Trosper3 Trosper3 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

problemData.nodes.map() threw "Cannot read properties of undefined (reading 'map')" whenever a frame arrived without a nodes or links array, crashing DFA/NFA Acceptance visualizations. Normalize both to [] before use, matching the same guard already in
StandardGraphSvgReact.js (the D3 graph renderer).

Fixes #168

problemData.nodes.map() threw "Cannot read properties of undefined
(reading 'map')" whenever a frame arrived without a nodes or links
array, crashing DFA/NFA Acceptance visualizations. Normalize both to
[] before use, matching the same guard already in
StandardGraphSvgReact.js (the D3 graph renderer).

Fixes #168

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011M2KW5z36iHV1StfmfeMvU
@github-actions

Copy link
Copy Markdown

Redux Build System — CI Report

npm · commit 0d4f912

Operation Status Summary Time
audit 1 high 0.5s
format-check 56 format · 31 import order 0.5s
lint 25 errors, 41 warnings 7.2s
typecheck ⏭️ no tsconfig.json
unit-test ⏭️ no test script in package.json
build built local/redux_gui:ci · 234MB 60.3s
integration-test /api/health ready · 4 passed 7.0s
push ⏭️ not implemented

Overall: ❌ 2 passed · 3 failed · 3 skipped

❌ audit — 1 high
Severity Location Rule Message
high svgo@3.0.0 - 3.3.3 GHSA-2p49-hgcm-8545 SVGO removeScripts plugin leaves some executable scripts intact
❌ format-check — 56 format · 31 import order
Severity Location Rule Message
error Tools/Constants.js format needs formatting
error Tools/ProblemInstanceParser.js format needs formatting
error biome.json format needs formatting
error components/ContributorCard.js format needs formatting
error components/Quantum/QuantumCircuitVisualizer.js assist/source/organizeImports Sort these imports.
error components/Quantum/QuantumCircuitVisualizer.js format needs formatting
error components/Quantum/circuitUtils.js format needs formatting
error components/Visualization/Graphvisualization.js format needs formatting
error components/Visualization/GraphvizWrapper.js assist/source/organizeImports Sort these imports.
error components/Visualization/QuantumCircuitVis.js assist/source/organizeImports Sort these imports.
error components/Visualization/QuantumCircuitVis.js format needs formatting
error components/Visualization/ReducedVisualization.js format needs formatting
error components/Visualization/constants/VisColors.js format needs formatting
error components/Visualization/constants/VisColorsArray.js assist/source/organizeImports Sort the exported names.
error components/Visualization/constants/VisColorsArray.js format needs formatting
error components/Visualization/openqasmToQText.js format needs formatting
error components/Visualization/svgs/DynamicTableSvgReact.js format needs formatting
error components/Visualization/svgs/LaTeXGraphSvgReact.js format needs formatting
error components/Visualization/svgs/No_Viz_SVG.js assist/source/organizeImports Sort these imports.
error components/Visualization/svgs/No_Viz_SVG.js format needs formatting
… and 68 more
❌ lint — 25 errors, 41 warnings
Severity Location Rule Message
error components/Visualization/QuantumCircuitVis.js:152 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Problem.js:51 no-undef 'requestInfo' is not defined.
error components/hooks/ProblemProvider/Problem.js:73 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:132 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:152 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:171 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:190 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:211 react-hooks/immutability Error: Cannot access variable before it is declared
error components/hooks/ProblemProvider/Reducer.js:215 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:51 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:74 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Solver.js:138 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Solver.js:24 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Verifier.js:87 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/pageblocks/ProblemRowReact.js:154 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/pageblocks/ProblemRowReact.js:163 react-hooks/immutability Error: This value cannot be modified
error components/pageblocks/VerifyRowReact.js:46 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/pageblocks/VerifyRowReact.js:52 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/pageblocks/VisualizeRowReact.js:135 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/pageblocks/VisualizeRowReact.js:139 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
… and 46 more

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.

javascript crash with DFA acceptance

1 participant