You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix BatchResult.from_items() to match JavaScript SDK behavior.
The previous implementation incorrectly checked conditions in the
wrong order, causing incorrect completion reasons for concurrent
operations with failure tolerance configurations.
The checkpointed completion reason is preserved during replay,
so existing executions are unaffected. Code with conditional
logic based on completion_reason might see different values after
this update.
Example: With 3 items (1 success, 2 failures) and tolerated_failure_count=1:
- Before: ALL_COMPLETED (incorrect - all items finished)
- After: FAILURE_TOLERANCE_EXCEEDED (correct - tolerance breached)
Changes:
- Extract completion reason logic to _get_completion_reason() method
- Check failure tolerance BEFORE checking if all completed
- Implement proper fail-fast when no completion config provided
- Add comprehensive unit tests covering all edge cases
This ensures tolerance checks take precedence over success criteria,
preventing operations from incorrectly reporting ALL_COMPLETED when
failure tolerance has been exceeded.
closes#280
0 commit comments