Code Review Bench PR #26629 - refactor: move WebWrapper files from packages/platform to apps/web/modules#9
Conversation
| if (weightA === weightB) { | ||
| return priorityA - priorityB; |
There was a problem hiding this comment.
⚠️ Bug: sortHosts equal-weights case reverses priority sort direction
The sortHosts function was changed from priorityB - priorityA to priorityA - priorityB in the equal-weights branch (when isRRWeightsEnabled is true and weights are equal). This reverses the sort order from descending (highest priority first) to ascending (lowest priority first).
In this codebase, priority values are: 0=lowest, 1=low, 2=medium, 3=high, 4=highest (see HostEditDialogs.tsx priorityOptions). The backend's getUsersWithHighestPriority in getLuckyUser.ts uses Math.max(...), confirming higher numbers = higher priority.
Old behavior (equal weights): priorityB - priorityA → hosts with priority 4 ("highest") sort first — correct
New behavior (equal weights): priorityA - priorityB → hosts with priority 0 ("lowest") sort first — incorrect
Note that the !isRRWeightsEnabled branch still uses priorityB - priorityA (descending), making the two code paths inconsistent. This will cause hosts with the lowest priority to appear first in the UI when round-robin weights are enabled and weights happen to be equal.
The PR context claims this is a bug fix, but the original code was correct for both branches. This change introduces a regression in host ordering.
Was this helpful? React with 👍 / 👎
| if (weightA === weightB) { | |
| return priorityA - priorityB; | |
| return priorityB - priorityA; |
- Apply suggested fix
| "./add-members-switch/AddMembersWithSwitchPlatformWrapper": "./add-members-switch/AddMembersWithSwitchPlatformWrapper.tsx", | ||
| "./add-members-switch/AddMembersWithSwitchWebWrapper": "./add-members-switch/AddMembersWithSwitchWebWrapper.tsx", | ||
| "./availability/AvailabilitySettings": "./availability/AvailabilitySettings.tsx", | ||
| "./booker": "./booker/index.ts", |
There was a problem hiding this comment.
⚠️ Bug: package.json "booker" export points to deleted index.ts file
The packages/platform/atoms/package.json still declares "./booker": "./booker/index.ts" in its exports, but booker/index.ts was deleted in this PR. Any external consumer (or future internal code) importing @calcom/atoms/booker will encounter a module resolution error at build time.
The export entry should either be removed (since BookerWebWrapper has moved to apps/web) or updated to point to the remaining export.ts in the booker directory if that's the intended entry point.
Was this helpful? React with 👍 / 👎
- Apply suggested fix
There was a problem hiding this comment.
Configure merge blocking · Maintainers can dismiss this review. Gitar never approves changes.
Code Review
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
Benchmark PR for Gitar evaluation
Original PR: agentic-review-benchmarks#9
refactor: move WebWrapper files from packages/platform to apps/web/modules
Summary by Gitar
packages/platform/atomstoapps/web/modulesfor better code localitypackages/lib/bookings/hostGroupUtils.ts:56(reversed comparison operator)apps/web/modules/*This will update automatically on new commits.