Skip to content

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 21, 2026

Benchmark PR from qodo-benchmark#716


Note

Decouples @calcom/atoms from TRPC server types by defining and consuming local types.

  • Introduces Slot, SlotInfo, and GetAvailableSlotsResponse in atoms/booker/types and switches consumers (useAvailableSlots, tests) to these
  • Adds hooks/schedules/types with Schedule-related return types, CreateScheduleInput, and a simple validateCreateScheduleInput; updates useAtomCreateSchedule, useAtomDuplicateSchedule, and useAtomGetAllSchedules to use them
  • Removes Slot type from trpc/server/routers/viewer/slots/types (TRPC no longer exports it)
  • Updates atoms package exports to ./booker/types and adjusts tsconfig/biome.json to restrict and remove TRPC imports
  • Test import updated to @calcom/atoms/booker/types

Written by Cursor Bugbot for commit 7f235e5. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

attendees?: number;
bookingUid?: string;
users?: string[];
};
Copy link

Choose a reason for hiding this comment

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

Slot userIds type changed from number[] to string[]

Medium Severity

The Slot type defines userIds as string[], but user IDs throughout the codebase are numbers. The original type in @calcom/trpc/server/routers/viewer/slots/types correctly defined userIds?: number[]. The slot generation code in packages/features/schedules/lib/slots.ts explicitly uses userIds?: number[] in its type definitions and return values. This type mismatch will cause TypeScript type errors when consuming code expects numeric user IDs.

Fix in Cursor Fix in Web

userId: number | null;
eventTypeId: number | null;
days: string[];
startTime: Date;
Copy link

Choose a reason for hiding this comment

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

Availability days type changed from number[] to string[]

Medium Severity

The days property in the availability array is typed as string[], but the Prisma Availability model defines days as Int[] (line 941 of the schema). In TypeScript, this translates to number[]. Days represent day-of-week values (0-6), which are numeric. This type mismatch will cause TypeScript errors when consuming code expects numeric day values.

Fix in Cursor Fix in Web

bookingUid?: string;
away?: boolean;
fromUser?: {
id: string;
Copy link

Choose a reason for hiding this comment

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

SlotInfo fromUser.id type changed from number to string

Medium Severity

The fromUser.id property is typed as string, but the original IFromUser interface in packages/features/availability/lib/getUserAvailability.ts defines id as number. User IDs throughout the codebase are numeric database identifiers. Notably, toUser.id in the same type is correctly typed as number, making this an inconsistency within the same type definition.

Fix in Cursor Fix in Web

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.

2 participants