#219 Replay: Handle timer race conditions with event delivery
Description
Edit## Problem
When workflow sleeps, if event arrives before wake time, ordering is not guaranteed.
## Scenario
- Workflow calls ctx.sleep(60)
- Event arrives at t+30 via emit_event()
- Both available_at and event wake mechanisms trigger
## Gap
- No guarantee on execution order
- Different path on replay vs production possible
- Non-deterministic behavior
## Impact
- Subtle bugs in timer + event workflows
- Replay may diverge from original execution
## Solution
1. Document expected behavior clearly
2. Add ordering guarantees (event takes priority?)
3. Log which wake mechanism was used
4. Validate in replay that same mechanism used
## Effort: Medium
Comments
Loading comments...
Context
Loading context...
Audit History
View AllLoading audit history...