Require both onComplete and context or neither#253
Conversation
commit: |
onComplete and context together or neitheronComplete and context or neither
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: get-convex/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR refactors the type contracts for workflow callback options from optional individual fields to discriminated unions. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |

Fixes #252
This PR adds tests verifying that the
contextvalue passed toonCompleteis correctly round-tripped through workflow failure paths — both when the workflow handler throws and when it returns an oversized result — covering both the direct mutation call andworkflow.start()invocation styles.It also tightens the
CallbackOptionsandWorkflowArgstypes so thatonCompleteandcontextmust be provided together or not at all, using a discriminated union. This prevents callers from supplying one without the other, which was previously allowed but semantically invalid.