{"record":{"id":"1f9aa28dce1642cd","repo":"GraphiteEditor/Graphite","slug":"failed-to-create-path-node","errorCode":null,"errorMessage":"Failed to create path node","messagePattern":"Failed to create path node","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"editor/src/messages/tool/common_functionality/graph_modification_utils.rs","lineNumber":120,"sourceCode":"\n\t// Add a Combine Paths node after the merge\n\tlet combine_paths_node_id = NodeId::new();\n\tlet combine_paths_node = document_node_definitions::resolve_proto_node_type(graphene_std::vector::combine_paths::IDENTIFIER)\n\t\t.expect(\"Failed to create combine paths node\")\n\t\t.default_node_template();\n\tresponses.add(NodeGraphMessage::InsertNode {\n\t\tnode_id: combine_paths_node_id,\n\t\tnode_template: Box::new(combine_paths_node),\n\t});\n\tresponses.add(NodeGraphMessage::MoveNodeToChainStart {\n\t\tnode_id: combine_paths_node_id,\n\t\tparent: first_layer,\n\t});\n\n\t// Add a path node after the combine paths node\n\tlet path_node_id = NodeId::new();\n\tlet path_node = document_node_definitions::resolve_network_node_type(\"Path\")\n\t\t.expect(\"Failed to create path node\")\n\t\t.default_node_template();\n\tresponses.add(NodeGraphMessage::InsertNode {\n\t\tnode_id: path_node_id,\n\t\tnode_template: Box::new(path_node),\n\t});\n\tresponses.add(NodeGraphMessage::MoveNodeToChainStart {\n\t\tnode_id: path_node_id,\n\t\tparent: first_layer,\n\t});\n\n\t// Add a Spline node after the Path node if both the layers we are merging is spline.\n\tif current_and_other_layer_is_spline {\n\t\tlet spline_node_id = NodeId::new();\n\t\tlet spline_node = document_node_definitions::resolve_proto_node_type(graphene_std::vector::spline::IDENTIFIER)\n\t\t\t.expect(\"Failed to create Spline node\")\n\t\t\t.default_node_template();\n\t\tresponses.add(NodeGraphMessage::InsertNode {\n\t\t\tnode_id: spline_node_id,","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/GraphiteEditor/Graphite/blob/c507b356453361e31638b8bff8f6d46b6da2961e/editor/src/messages/tool/common_functionality/graph_modification_utils.rs#L102-L138","documentation":"The merge flow finishes by inserting a 'Path' node via resolve_network_node_type(\"Path\").expect(\"Failed to create path node\"). Identical failure mode to the Merge and Combine Paths lookups: DOCUMENT_NODE_TYPES has no DefinitionIdentifier::Network(\"Path\") entry, so resolution returns None and the expect panics mid-merge, leaving the graph in a partially-modified state (the earlier MoveLayerToStack/InsertNode messages were already queued).","triggerScenarios":"Executing layer merge when the 'Path' network node identifier was renamed or excluded from the node registry in the current build.","commonSituations":"Registry refactors renaming Path (e.g., to a namespaced identifier) without updating this string; build configurations that omit basic path nodes.","solutions":["Sync the string literal with the registry identifier after renames (search for \\\"Path\\\" when touching node definitions)","Replace the expect with a logged early-return so the merge aborts before mutating the graph further","Cover all three identifiers used by merge_layers ('Merge', combine_paths::IDENTIFIER, 'Path') with a resolution unit test"],"exampleFix":"// before\nlet path_node = document_node_definitions::resolve_network_node_type(\"Path\")\n\t.expect(\"Failed to create path node\")\n\t.default_node_template();\n\n// after\nlet Some(path_def) = document_node_definitions::resolve_network_node_type(\"Path\") else {\n\tlog::error!(\"Path node definition missing from registry\");\n\treturn;\n};\nlet path_node = path_def.default_node_template();","handlingStrategy":"validation","validationCode":"let Some(path_def) = document_node_definitions::resolve_network_node_type(\"Path\") else {\n\tlog::error!(\"'Path' node definition missing from registry\");\n\treturn;\n};","typeGuard":"fn node_type_registered(identifier: &str) -> bool {\n\tdocument_node_definitions::resolve_network_node_type(identifier).is_some()\n}","tryCatchPattern":null,"preventionTips":["Keep a single list of built-in identifiers used by tooling and assert their resolvability in tests","Abort multi-step graph edits before the first mutation if any required node type is unresolved","When introducing feature-gated nodes, audit string-based lookups like 'Path' and 'Merge' for exclusion"],"tags":["rust","node-registry","layer-merge","lookup-miss","panic"],"backgroundTag":"node-definition-not-found","analyzedSha":"c507b356453361e31638b8bff8f6d46b6da2961e","analyzedAt":"2026-08-16T21:57:18.596Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}