{"record":{"id":"0bd66711f712468a","repo":"windmill-labs/windmill","slug":"nested-argument-not-found-0bd667","errorCode":null,"errorMessage":"Nested argument not found!","messagePattern":"Nested argument not found!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/schema/AddPropertyV2.svelte","lineNumber":129,"sourceCode":"\t\t}\n\n\t\tif (argError !== '') {\n\t\t\tsendUserToast(argError, true)\n\t\t}\n\t}\n\n\texport function handleDeleteArgument(argPath: string[], nschema?: Schema): void {\n\t\ttry {\n\t\t\tlet modifiedObject: Schema = { ...(nschema ?? schema) }\n\t\t\tlet modifiedProperties = modifiedObject.properties as object\n\t\t\tlet argName = argPath.pop() as string\n\n\t\t\targPath.forEach((property) => {\n\t\t\t\tif (Object.keys(modifiedProperties).includes(property)) {\n\t\t\t\t\tmodifiedObject = modifiedProperties[property]\n\t\t\t\t\tmodifiedProperties = modifiedObject.properties as object\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error('Nested argument not found!')\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tif (Object.keys(modifiedProperties).includes(argName)) {\n\t\t\t\tdelete modifiedProperties[argName]\n\n\t\t\t\tif (modifiedObject.required) {\n\t\t\t\t\tmodifiedObject.required = schema.required.filter((arg) => arg !== argName)\n\t\t\t\t}\n\t\t\t\tif (modifiedObject.order) {\n\t\t\t\t\tmodifiedObject.order = modifiedObject.order.filter((arg) => arg !== argName)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow Error('Argument not found!')\n\t\t\t}\n\t\t\tsyncOrders(modifiedObject)\n\t\t\tschema = $state.snapshot(modifiedObject)\n\t\t} catch (err) {","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/schema/AddPropertyV2.svelte#L111-L147","documentation":"Same traversal guard as 1335 but in AddPropertyV2.svelte: while walking `argPath` through the (Svelte 5 $state) schema's nested `properties`, a missing intermediate property name aborts the delete with this error.","triggerScenarios":"Deleting a nested argument when the schema no longer contains one of the intermediate objects in argPath — parent deleted, renamed, or schema snapshot out of sync with the UI tree.","commonSituations":"Edits made in another tab or by a collaborator, external schema replacement, or stale argPath after undo/redo in the V2 schema editor.","solutions":["Refresh the schema editor and retry","Confirm the nested parent object still exists with the exact name in argPath","Rebuild the delete action from the current UI selection rather than a stored path","Edit the schema JSON directly to remove the nested property"],"exampleFix":"// defensive traversal\nfor (const property of argPath) {\n  if (!(property in (modifiedProperties ?? {}))) { await reloadSchema(); return; }\n  modifiedObject = modifiedProperties[property];\n  modifiedProperties = modifiedObject.properties;\n}","handlingStrategy":"type-guard","validationCode":"let node = $state.snapshot(schema);\nfor (const seg of argPath) {\n  if (!node?.properties?.[seg]) { console.warn('Stale nested path:', seg); return; }\n  node = node.properties[seg];\n}","typeGuard":"function nestedPathExists(schema: any, path: string[]): boolean {\n  let node = schema;\n  for (const seg of path) {\n    if (!node?.properties || !(seg in node.properties)) return false;\n    node = node.properties[seg];\n  }\n  return true;\n}","tryCatchPattern":"try { await handleDeleteArgument(arg); } catch (e) {\n  if (/Nested argument not found/.test(String(e))) await reloadSchema();\n  else throw e;\n}","preventionTips":["Use $state.snapshot() before traversing to avoid proxies/stale reads","Reload the schema after external edits or undo/redo","Prevent concurrent editors on the same schema"],"tags":["schema","ui","state-mismatch","svelte5"],"backgroundTag":"stale-schema-path","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}