-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: Remove trpc/server dependency from @calcom/atoms #78
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
base: cursor_combined_20260121_qodo_grep_cursor_copilot_1_base_refactor_remove_trpc_server_dependency_from_calcom_atoms_pr716
Are you sure you want to change the base?
Conversation
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.
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[]; | ||
| }; |
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.
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.
| userId: number | null; | ||
| eventTypeId: number | null; | ||
| days: string[]; | ||
| startTime: Date; |
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.
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.
| bookingUid?: string; | ||
| away?: boolean; | ||
| fromUser?: { | ||
| id: string; |
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.
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.
Benchmark PR from qodo-benchmark#716
Note
Decouples
@calcom/atomsfrom TRPC server types by defining and consuming local types.Slot,SlotInfo, andGetAvailableSlotsResponseinatoms/booker/typesand switches consumers (useAvailableSlots, tests) to thesehooks/schedules/typeswithSchedule-related return types,CreateScheduleInput, and a simplevalidateCreateScheduleInput; updatesuseAtomCreateSchedule,useAtomDuplicateSchedule, anduseAtomGetAllSchedulesto use themSlottype fromtrpc/server/routers/viewer/slots/types(TRPC no longer exports it)atomspackage exports to./booker/typesand adjuststsconfig/biome.jsonto restrict and remove TRPC imports@calcom/atoms/booker/typesWritten by Cursor Bugbot for commit 7f235e5. Configure here.