Skip to content

Conversation

@hila-f-qodo
Copy link

@hila-f-qodo hila-f-qodo commented Jan 26, 2026

Benchmark PR from qodo-benchmark#708


Open with Devin

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View issues and 5 additional flags in Devin Review.

Open in Devin Review

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Undefined router variable causes runtime errors in BookerWebWrapper

The router variable is used in multiple places but is never defined in the component.

Click to expand

Problem:

The component uses router at lines 193, 195, 228, 232, and 238, but there is no const router = useRouter() or similar declaration.

Looking at the imports at line 4:

import { useSearchParams, usePathname } from "next/navigation";

The useRouter import was removed during the refactor, but the router usage remained.

Affected code:

// Line 193
router.push(`${url.pathname}${url.search}`);
// Line 195
[router]
// Line 228
router.push(newPath);
// Line 232
router.push("/apps/categories/calendar");
// Line 238
router.push(newUrl.toString());

Impact:

This will cause a ReferenceError: router is not defined at runtime when users interact with:

  • The overlay calendar switch
  • The instant meeting "Connect Now" button
  • The "No Calendar" overlay click handler
  • The overlay continue button

(Refers to line 193)

Recommendation: Add import { useRouter } from "next/navigation"; and define const router = useRouter(); inside the BookerWebWrapperComponent function.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


if (isRRWeightsEnabled) {
if (weightA === weightB) {
return priorityA - priorityB;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 sortHosts function has reversed priority sorting order when weights are equal

The sortHosts function was moved from HostEditDialogs.tsx to hostGroupUtils.ts, but the sorting logic for priority was changed incorrectly.

Click to expand

Original code (correct):

if (weightA === weightB) {
  return priorityB - priorityA; // Descending - higher priority first
}

New code (incorrect):

if (weightA === weightB) {
  return priorityA - priorityB; // Ascending - lower priority first
}

Impact:

When round-robin weights are enabled and two hosts have equal weights, the hosts will now be sorted with lower priority hosts appearing first instead of higher priority hosts. This affects:

  • PriorityDialog in HostEditDialogs.tsx:82
  • WeightDialog in HostEditDialogs.tsx:178
  • useEventTypeForm hook in packages/platform/atoms/event-types/hooks/useEventTypeForm.ts:103
  • EventTeamAssignmentTab in apps/web/modules/event-types/components/tabs/assignment/EventTeamAssignmentTab.tsx

This reverses the expected behavior where hosts with higher priority (e.g., 4 = "highest") should appear before hosts with lower priority (e.g., 0 = "lowest").

Recommendation: Change line 53 from return priorityA - priorityB; to return priorityB - priorityA; to maintain the original descending sort order for priority.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants