Commit 2673cc9
fix(templates): keep the parent task when a subtask fails to apply
createSubtasksFromTemplate rolled back on failure by soft-deleting `parentId`
— which is the *parent* (main) task, not the failed subtask. So any single
subtask-creation error (e.g. the connection-pool P2024) silently deleted the
task the user had just created and verified, and Realtime made it vanish from
their screen ("task disappeared on its own" in OUT-3964). The rollback was also
wrong (it orphaned already-created sibling subtasks) and unnecessary — createTask
already cleans up a half-created subtask via its own catch.
Now each subtemplate is applied best-effort: the whole per-subtemplate unit
(getAppliedTemplateDescription + create) runs inside one try/catch that skips
and logs on failure instead of throwing. Because the handler no longer rejects,
runInBatches never aborts, so every subtemplate is attempted and one failure no
longer skips later batches or returns an error after a partial write (fixes the
two P1 review findings). The parent task is never deleted or orphaned.
Refactored createSubtasksFromTemplate to object params and folded the applied-
description fetch inside it, so both the internal and public call sites share the
same failure isolation.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 05dea0e commit 2673cc9
3 files changed
Lines changed: 36 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
277 | | - | |
278 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
279 | 283 | | |
280 | 284 | | |
281 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
258 | | - | |
259 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
260 | 264 | | |
261 | 265 | | |
262 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
589 | 590 | | |
590 | 591 | | |
591 | 592 | | |
592 | | - | |
593 | | - | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
594 | 604 | | |
595 | 605 | | |
596 | 606 | | |
| 607 | + | |
| 608 | + | |
597 | 609 | | |
598 | 610 | | |
599 | 611 | | |
| |||
608 | 620 | | |
609 | 621 | | |
610 | 622 | | |
611 | | - | |
| 623 | + | |
612 | 624 | | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
621 | 631 | | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | 632 | | |
629 | 633 | | |
630 | 634 | | |
| |||
0 commit comments