enforce runAt and runAfter exclusivity in EnqueueOptions#178
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughEnhanced the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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 |
commit: |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/client/index.ts (1)
443-456:⚠️ Potential issue | 🟡 MinorFix formatting inconsistency to pass Prettier check.
The mutual exclusivity pattern using
neveris correct and idiomatic TypeScript. However, there's inconsistent punctuation: line 445 uses a semicolon (runAfter?: never;) while line 455 uses a comma (runAt?: never,). This inconsistency is likely contributing to the Prettier failure flagged in CI.Run
prettier --writeto auto-fix, or manually ensure consistent punctuation across both branches.Suggested fix
runAt?: number; - - runAfter?: never; + runAfter?: never; } | { /** * The number of milliseconds to run the action after. * If not provided, the action will be run as soon as possible. * Note: this is advisory only. It may run later. */ runAfter?: number; - - runAt?: never, + runAt?: never; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/client/index.ts` around lines 443 - 456, The union branches that define runAt/runAfter are inconsistent: in the first branch the property "runAfter?: never;" ends with a semicolon, while in the second branch "runAt?: never," ends with a comma, causing Prettier failure; edit the second branch to use the same punctuation (change the trailing comma on the "runAt?: never" line to a semicolon) or run prettier --write to normalize formatting in the type definition that contains the runAt/runAfter mutually exclusive properties.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/client/index.ts`:
- Around line 443-456: The union branches that define runAt/runAfter are
inconsistent: in the first branch the property "runAfter?: never;" ends with a
semicolon, while in the second branch "runAt?: never," ends with a comma,
causing Prettier failure; edit the second branch to use the same punctuation
(change the trailing comma on the "runAt?: never" line to a semicolon) or run
prettier --write to normalize formatting in the type definition that contains
the runAt/runAfter mutually exclusive properties.
d440d8b to
f7ce2ba
Compare
ianmacartney
left a comment
There was a problem hiding this comment.
I think most of the time it'll warn if you're providing a key that is unexpected, but if you have an object with both as optional it wouldn't complain. Can you check if the Workflow component uses this type or will be impacted by this?
|
It looks like workflow is going to be impacted since it redefines its own version of its type to pass into the workpool enqueue function. I can change it there as well |
ianmacartney
left a comment
There was a problem hiding this comment.
sounds good - let's update workflow first before releasing this version. though folks shouldn't see issues if they have mismatched versions unless they have skipLibCheck: false I suspect?
|
I released a version of workflow that also makes this change |
It looks like
runAtandrunAfterfields in EnqueueOptions are meant to be exclusive, but this isn't forced by the types currently.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Summary by CodeRabbit