Commit a2def5a
Always emit failure_category in FailureHandled history events
Closes #26 (TD-007). FailureHandled payloads previously omitted the
failure_category field — downstream consumers had to load the WorkflowFailure
DB row to see what kind of failure was caught. Now the event payload itself
carries the canonical FailureCategory enum value, with fallback ordering:
1. WorkflowFailure model (authoritative; enum-cast) when loaded from DB
2. failurePayload['failure_category'] (used for child-propagated failures
where the payload is copied from the child's WorkflowFailed event)
3. FailureCategory::Application as catch-all so the field is always present
resolveFailureHandledCategory rejects non-enum values via tryFrom, so
unmappable dev-era strings won't leak through — matching the issue
directive that v2 dev artifacts get dropped, not preserved with shims.
Test coverage extends testWorkflowCanHandleActivityFailureAndContinue to
assert (a) the payload's category matches the WorkflowFailure row and
(b) it's a member of the FailureCategory enum.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 20de2c8 commit a2def5a
2 files changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2947 | 2947 | | |
2948 | 2948 | | |
2949 | 2949 | | |
| 2950 | + | |
2950 | 2951 | | |
2951 | 2952 | | |
2952 | 2953 | | |
2953 | 2954 | | |
| 2955 | + | |
2954 | 2956 | | |
2955 | 2957 | | |
2956 | 2958 | | |
| |||
2968 | 2970 | | |
2969 | 2971 | | |
2970 | 2972 | | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
| 2997 | + | |
| 2998 | + | |
| 2999 | + | |
| 3000 | + | |
2971 | 3001 | | |
2972 | 3002 | | |
2973 | 3003 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4311 | 4311 | | |
4312 | 4312 | | |
4313 | 4313 | | |
| 4314 | + | |
| 4315 | + | |
| 4316 | + | |
| 4317 | + | |
| 4318 | + | |
| 4319 | + | |
4314 | 4320 | | |
4315 | 4321 | | |
4316 | 4322 | | |
| |||
0 commit comments