Skip to content

Conversation

@ParidelPooya
Copy link
Contributor

fix minSuccessful issue in map/parallel

anthonyting and others added 10 commits December 8, 2025 15:35
…hedAncestor functionality

- Removed pendingCompletions Set from ExecutionContext
- Removed hasPendingAncestorCompletion and hasFinishedAncestor methods from CheckpointManager
- Removed ancestor checking logic from checkpoint operations
- Removed related unit tests that were testing the removed functionality
- All main SDK tests now pass (725/725)
- 8 callback-related example tests are failing due to operation lifecycle issues
…on cleanup

- Remove operation deletion from CheckpointManager to prevent race conditions
- Keep operations in map while cleaning up resources to maintain lifecycle
- Resolves issue where callback operations failed when parent contexts completed
- All 8 previously failing wait-for-callback tests now pass
- Add markOperationState calls to track operation lifecycle
- Mark operations as IDLE_NOT_AWAITED when started
- Mark operations as COMPLETED when finished (success or failure)
- Update test mock to include markOperationState method
- Maintains consistency with other handlers like wait-handler
- All tests passing (69/69 test suites, 725/725 tests)
- Add CHILD_IS_EXECUTING state to OperationLifecycleState enum
- Add metadata to all markOperationState calls across all handlers:
  - callback-promise.ts: 2 calls with proper operation metadata
  - invoke-handler.ts: 2 calls with CHAINED_INVOKE metadata
  - run-in-child-context-handler.ts: 3 calls with CONTEXT metadata
  - wait-for-condition-handler.ts: 2 calls with WAIT_FOR_CONDITION metadata
  - step-handler.ts: 3 calls with STEP metadata
  - wait-handler.ts: 1 call with WAIT metadata
- Add ancestor completion check in checkpoint() method
- Update cleanup logic to include CHILD_IS_EXECUTING state
- Fix 'metadata required on first call' errors in callback tests
- Ensure consistent operation lifecycle management across all handlers
…om being sent to checkpoint

- Add ancestor completion check in processBatch to filter out operations
- Operations with completed ancestors are resolved locally instead of sent to testing library
- Fixes issue where remaining operations showed SUCCEEDED instead of STARTED in minSuccessful scenarios
- Resolves parallel and map minSuccessful test failures
- Filter only START actions when ancestor is completed to prevent operations from updating after parent completion
- Allow completion events (SUCCEED/FAIL) to pass through to maintain correct execution history
- Remove debug logging statements that were interfering with tests
- MinSuccessful tests now pass correctly with remaining operations staying in STARTED state
- Add batch-level filtering in processBatch to prevent operations from being sent to testing library when their ancestor has already completed
- This fixes the issue where remaining operations in minSuccessful scenarios were showing SUCCEEDED status instead of STARTED
- The filtering ensures that once a parent context completes (e.g., due to minSuccessful threshold), child operations don't send updates
- MinSuccessful tests now pass correctly with proper operation status tracking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants