Skip to content

Conversation

@emrysal
Copy link
Contributor

@emrysal emrysal commented Jan 9, 2026

Summary by cubic

Extracted schedule selection into a dedicated function to simplify getUserAvailability and make timezone fallback logic clearer. No functional changes expected.

  • Refactors
    • Added detectEventTypeScheduleForUser to choose schedule and report isDefaultSchedule/isTimezoneSet.
    • Introduced ScheduleWithoutTimeZone and DEFAULT_SCHEDULE_DATA.
    • Simplified timezone resolution, using delegated calendar TZ only when needed.
    • Made GetUserAvailabilityResult explicit and typed _getUserAvailability accordingly.
    • Imported WorkingHoursWithUserId and removed inline schedule logic and redundant debug logging.

Written for commit 6bf6b44. Summary will update on new commits.

@vercel
Copy link

vercel bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Review Updated (UTC)
api-v2 Ignored Ignored Preview Jan 10, 2026 4:51pm
cal Ignored Ignored Jan 10, 2026 4:51pm
cal-companion Ignored Ignored Preview Jan 10, 2026 4:51pm
cal-eu Ignored Ignored Jan 10, 2026 4:51pm

@emrysal emrysal marked this pull request as ready for review January 9, 2026 02:42
@emrysal emrysal requested a review from a team as a code owner January 9, 2026 02:42
@emrysal emrysal enabled auto-merge (squash) January 9, 2026 02:42
@graphite-app graphite-app bot added core area: core, team members only foundation labels Jan 9, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

Copy link
Contributor

@volnei volnei left a comment

Choose a reason for hiding this comment

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

🚀

@emrysal emrysal merged commit 312733c into main Jan 11, 2026
72 of 74 checks passed
@emrysal emrysal deleted the refactor/extract-schedule-logic-to-fn branch January 11, 2026 22:44
Anshumancanrock pushed a commit to Anshumancanrock/cal.com that referenced this pull request Jan 12, 2026
* refactor: Extract schedule determination to seperate fn

* refactor: Extract schedule detection to seperate file and add tests

* RouterOutputs should be used in hooks, not direct type imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants