-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix broken queue mock. #160
Conversation
🦋 Changeset detectedLatest commit: 9b71567 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe changes involve modifications to the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@zemble/auth
@zemble/auth-anonymous
@zemble/auth-apple
@zemble/auth-api-token
@zemble/auth-otp
@zemble/bull
@zemble/bun
@zemble/core
create-zemble-app
create-zemble-plugin
@zemble/debug
@zemble/email-resend
@zemble/email-sendgrid
eslint-config-kingstinct
@zemble/firebase-auth
@zemble/graphql
@zemble/kv
@zemble/migrations
@zemble/mongodb
@zemble/node
@zemble/pino
@zemble/push-apple
@zemble/push-expo
@zemble/routes
@zemble/react
@zemble/sms-46elks
@zemble/sms-twilio
@zemble/supabase
@zemble/utils
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
packages/bull/ZembleQueueMock.ts (3)
28-28
: Consider using a private class field for stronger encapsulation.TypeScript's
private
modifier only provides compile-time privacy. Consider using the#
prefix for runtime privacy guarantees:- private jobsRemaining = 0 + #jobsRemaining = 0
97-104
: LGTM! Consider using a cleaner decrement syntax.The async/await changes and the placement in the finally block are correct. However, to maintain consistency with the codebase style:
- this.jobsRemaining-- + this.jobsRemaining -= 1
114-118
: Consider using queueMicrotask for better job scheduling.A few suggestions to improve this section:
- Use a cleaner increment syntax
- Replace setTimeout with queueMicrotask for more predictable timing
- this.jobsRemaining++ - setTimeout(async () => { - await this.#executeWorker(job) - }, 0) + this.jobsRemaining += 1 + queueMicrotask(async () => { + await this.#executeWorker(job) + })
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/bull/ZembleQueueMock.ts
(5 hunks)
🔇 Additional comments (1)
packages/bull/ZembleQueueMock.ts (1)
Line range hint
152-156
: LGTM! The promise resolution logic is correct.The changes to use the new
jobsRemaining
property are consistent, and the promise resolution logic remains sound.Also applies to: 162-163
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good 👍
Summary by CodeRabbit