-
Notifications
You must be signed in to change notification settings - Fork 10.4k
perf: Prevent parse when object is empty, resulting in a truthy value #22625
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
Conversation
WalkthroughThe changes introduce additional validation when parsing the Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/lib/getUserAvailability.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-playwright". (The package "eslint-plugin-playwright" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-playwright" was referenced from the config file in ".eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. packages/trpc/server/routers/viewer/slots/util.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-playwright". (The package "eslint-plugin-playwright" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-playwright" was referenced from the config file in ".eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (2)packages/lib/getUserAvailability.ts (2)
packages/trpc/server/routers/viewer/slots/util.ts (2)
🧬 Code Graph Analysis (2)packages/lib/getUserAvailability.ts (2)
packages/trpc/server/routers/viewer/slots/util.ts (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (2)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
✅ No security or compliance issues detected. Reviewed everything up to b4300f6. Security Overview
Detected Code Changes
Reply to this PR with |
Object.keys(eventType?.durationLimits).length > 0 | ||
? parseDurationLimit(eventType?.durationLimits) | ||
: null; | ||
|
||
let busyTimesFromLimitsBookingsAllUsers: Awaited<ReturnType<typeof getBusyTimesForLimitChecks>> = []; | ||
|
||
if (eventType && (bookingLimits || durationLimits)) { |
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.
This was actually executed at all times, because both bookingLimits and durationLimits were parsed {}
and that's truthy. This function firing when not needed adds significant overhead; Which was completely unnecessary.
Graphite Automations"Add ready-for-e2e label" took an action on this PR • (07/18/25)1 label was added to this PR based on Keith Williams's automation. |
E2E results are ready! |
What does this PR do?
Remove overhead of database call for an estimated majority of runs by fixing a truthy value to become falsy, preventing additional logic from executing