-
Notifications
You must be signed in to change notification settings - Fork 3
fix(native): napi-rs null visibility crashes insertNodes #687
Copy link
Copy link
Closed
Description
Bug
The native (Rust) engine crashes during insertNodes when a definition or child node has visibility: null:
Error: Failed to convert JavaScript value `Null` into rust type `String`
on InsertNodesDefinition.visibility on InsertNodesBatch.definitions
Root cause
In insert-nodes.ts, the marshaling code coerces undefined to null:
visibility: def.visibility ?? null,napi-rs v3 #[napi(object)] for Option<String> handles undefined → None correctly, but when it sees null, it attempts to convert it as String (not None), which fails.
Parameters and some children created by extractors don't set a visibility field (it's undefined in JS). The ?? null coercion turns this into an explicit null, triggering the napi conversion error.
Impact
- Native engine cannot build any graph — complete build failure
- v3.5.0 benchmarks have
"native": nullfor all benchmark types - Affects all codebases (parameters are universal)
Fix
Remove ?? null coercion for Option<String> fields in the native marshaling path. Let undefined flow through naturally so napi-rs converts it to None.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels