fix: don't let a single unrenderable input abort the whole workflow render - #160
Merged
timurbazhirov merged 1 commit intoJul 29, 2026
Merged
Conversation
…ender ExecutionUnitInput.render() rethrew on any Nunjucks template error. That propagates uncaught through ExecutionUnit.render() -> Subworkflow.render() -> Workflow.render() -> job.render(), which job-designer's JOB_WORKFLOW_SYNC and JOB_UPDATE reducers call unconditionally. Selecting a multi-material workflow (e.g. Valence Band Offset, whose interface-left/right units are keyed by MATERIAL_INDEX "1"/"2" into input.perMaterial) while the job still only has its single default material makes perMaterial[1]/[2] undefined, which the sprintf filter throws on - crashing the reducer and silently aborting the workflow selection itself (job-designer's onSelectWorkflowsSubmit only console.errors the rejected promise, so the UI just stays on the old workflow with no visible error). Fall back to the raw template on render error instead of rethrowing, so the reducer completes and the workflow selection actually applies. The next job/material update re-runs render() and produces a correct preview once enough materials are assigned.
5 tasks
timurbazhirov
deleted the
fix/execution-unit-input-render-graceful-degradation
branch
July 29, 2026 22:21
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.
Summary
ExecutionUnitInput.render()rethrew on any Nunjucks template error. That propagates uncaught throughExecutionUnit.render()->Subworkflow.render()->Workflow.render()->job.render(), which job-designer'sJOB_WORKFLOW_SYNC/JOB_UPDATEreducers call unconditionally.MATERIAL_INDEX"1"/"2"intoinput.perMaterial) while the job still only has its single default material makesperMaterial[1]/[2]undefined, which thesprintffilter throws on - crashing the reducer and silently aborting the workflow selection itself. job-designer'sonSelectWorkflowsSubmitonlyconsole.errors the rejected promise, so the UI just stays on the old workflow with no visible error to the user.this.rendered = rendered || this.template.contentfallback for empty output. The debugconsole.errorlogging is preserved. The next job/material update re-runsrender()and produces a correct preview once enough materials are assigned.Root cause chain (for reviewers)
reference/job-designer/src/reducers/renderJobForDesignerState.jscallsjob.render()unconditionally on everyJOB_UPDATE/JOB_WORKFLOW_SYNC.Workflow.render()->Subworkflow.render()->ExecutionUnit.render()render every unit in every subworkflow, not just the one currently visible.reference/standata/data/workflows/workflows/espresso/valence_band_offset.json) has "Set Material Index" assignment units settingMATERIAL_INDEXto"0"/"1"/"2"for its combined/left/right branches, and several unit templates guard onsubworkflowContext.MATERIAL_INDEXto index intoinput.perMaterial[...].perMaterialhas only index0-perMaterial[1]/perMaterial[2]areundefined.ExecutionUnitInput.render()calls the customsprintffilter (reference/standata/src/js/utils/template.ts) withundefined, which throwsTypeError: [sprintf] expecting number but found undefined- previously uncaught here, now handled.Test plan
npm testinreference/wode- 47/47 passing, no regressions.node_modulescopy + full rspack cache clear/restart), the workflow correctly switches, all 7 VBO subworkflows populate, and the "average ESP" unit (the elementjob-espresso-valence-band-offset.featureneeds) is present and clickable.cypress run --spec cypress/e2e/jobs/run/job-espresso-valence-band-offset.featurein web-app: previously failed at "I open 'average ESP' subworkflow unit" (never found); now progresses past that entirely into a later, unrelated bug (duplicate "cutoffs" panel in Important Settings causing an ambiguouscy.focus()match - tracked separately, not part of this PR).🤖 Generated with Claude Code