fix(web): 3D orphan preflight must return the string error, not the preflight object - #94
Merged
Merged
Conversation
…reflight object PR #75's preflight-parity commit (85a74c9) left a { error, connectedNodes } return inside the 3D disconnected-node branch, where the declared contract is SolverInput3D | string | null (now prepareSolve3D). tsc reports TS2353; main's CI has no typecheck gate, so it slipped through. Runtime impact: callers detect failure with typeof result === 'string', so the object sailed past the guard. The sync path then fed the object into the WASM solver (confusing parse error instead of the orphan message); the async path (PR #77) crashed inside input3DToWireObject on input.nodes === undefined. Fix: return the plain error string, mirroring every sibling branch; the { error, connectedNodes } shape stays internal to preflightModel2D (2D), whose contract is valid. Regression coverage: orphan 3D model asserts the STRING error on both validateAndSolve3D and validateAndSolve3DAsync (constraint-connectivity.test.ts negative control).
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.
Confirma el defecto reportado por QA sobre
origin/main(introducido por 85a74c9, el fix de preflight-parity de PR #75):Defecto
La rama de nodo desconectado de
prepareSolve3D(antes cuerpo inline devalidateAndSolve3D) retornaba{ error, connectedNodes }— el shape del helperpreflightModel2D(2D) — donde el contrato declarado esSolverInput3D | string | null.Impacto en runtime
Los callers detectan falla con
typeof result === 'string', así que el objeto pasaba el guard:input3DToWireObject(input)crasheaba coninput.nodes === undefined— TypeError en vez del string de error.Escapó CI porque main no corre typecheck gate (el build de vite no typecheckea).
Fix
La rama retorna el string plano, como todas sus hermanas. El shape
{ error, connectedNodes }queda interno apreflightModel2D(2D), cuyo contrato es válido. Verificado: TS2353 eliminado detsc --noEmit.Regresión
Dos tests nuevos en el control negativo de
constraint-connectivity.test.ts: modelo 3D con nodo huérfano asserta el error string correcto tanto envalidateAndSolve3Dcomo envalidateAndSolve3DAsync(esta última pre-fix tiraba TypeError).Suite engine+store: 90 files, 2250 passed, 0 failed.