Skip to content

fix: refresh slots on timezone change for booker timezone restrictions#26026

Closed
hackice20 wants to merge 38 commits intocalcom:mainfrom
hackice20:fix/slots-refresh-on-timezone-change
Closed

fix: refresh slots on timezone change for booker timezone restrictions#26026
hackice20 wants to merge 38 commits intocalcom:mainfrom
hackice20:fix/slots-refresh-on-timezone-change

Conversation

@hackice20
Copy link
Copy Markdown
Contributor

What does this PR do?

Refreshes available slots when booker changes timezone on events with restriction schedules that use booker's timezone.
Previously slots weren't refreshing because conversion was client-side only. Now we detect timezone changes and refetch slots when needed.
Only refreshes when all conditions are met:
Timezone changed
Event has restrictionScheduleId
Event has useBookerTimezone: true
No unnecessary API calls for regular events.

Visual Demo (For contributors especially)

Video Demo (if applicable):

perfect-video.mp4

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Create event type with a restriction schedule and enable "Use booker's timezone"
  2. Open booking page in incognito
  3. Open DevTools → Network tab, filter by slots
  4. Change timezone in the booker
  5. Expected: New getSchedule API call fires, slots refresh

Checklist

  • I have read the contributing guide
  • My code does follow the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked if my changes generate no new warnings

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 18, 2025

@hackice20 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Dec 18, 2025
@github-actions github-actions bot added High priority Created by Linear-GitHub Sync ⚡ Quick Wins A collection of quick wins/quick fixes that are less than 30 minutes of work ✅ good first issue Good for newcomers 🐛 bug Something isn't working labels Dec 18, 2025
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 18, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
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 5 files

@hackice20
Copy link
Copy Markdown
Contributor Author

Hello @dhairyashiil can you please review my PR , thanking you in anticipation :)

@hackice20
Copy link
Copy Markdown
Contributor Author

hackice20 commented Dec 19, 2025

Hey @Ryukemeister ,Thanks for the suggestion! Refactored to use useMemo and simplified the logic as you suggested. All tests pass and the hook is now more efficient. Lmk what you think

@hackice20
Copy link
Copy Markdown
Contributor Author

@alishaz-polymath

@alishaz-polymath
Copy link
Copy Markdown
Member

Hi @hackice20
I will review the PR this week. Thank you for your efforts 🙌

@hackice20
Copy link
Copy Markdown
Contributor Author

Hi @hackice20 I will review the PR this week. Thank you for your efforts 🙌

thanks

@Nandinibajaj28
Copy link
Copy Markdown

I'm working on this

Copy link
Copy Markdown
Contributor

@Ryukemeister Ryukemeister left a comment

Choose a reason for hiding this comment

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

hi @hackice20, I saw another PR being created that was being referenced as a fix for this PR. i'm a bit confused, do you know what that is about? is it an edge case that we might be missing here or is it something different altogether? can you please work with @MaheshX18 to get this resolved, thank you!

@hackice20
Copy link
Copy Markdown
Contributor Author

hi @hackice20, I saw another PR being created that was being referenced as a fix for this PR. i'm a bit confused, do you know what that is about? is it an edge case that we might be missing here or is it something different altogether? can you please work with @MaheshX18 to get this resolved, thank you!

I'll read the code understand what this is about and get this resolved. NO Worries.

@hackice20
Copy link
Copy Markdown
Contributor Author

@Ryukemeister Mahesh's PR works on query level and has complete coverage of booker, platform, embed, etc.
To improve this PR I can either call useTimezoneChangeDetection in BookerWebWrapper.tsx , Embed.tsx , BookerPlatformWrapper.tsx , EventTypeCalendarViewComponent.tsx or I can adopt the query level calling.

@alishaz-polymath
Copy link
Copy Markdown
Member

@hackice20 Type checks still failing

@alishaz-polymath alishaz-polymath added run-ci Approve CI to run for external contributors and removed run-ci Approve CI to run for external contributors labels Jan 19, 2026
@alishaz-polymath alishaz-polymath added run-ci Approve CI to run for external contributors and removed run-ci Approve CI to run for external contributors labels Jan 19, 2026
@alishaz-polymath
Copy link
Copy Markdown
Member

Types are still failing @hackice20
Do you mind if I take it over and get it over the line?

@alishaz-polymath
Copy link
Copy Markdown
Member

Hey @hackice20 I haven't been able to spare time to look at this yet, but I wanted to let you know this isn't forgotten. I just need to find time to look into this further 🙏

@hackice20
Copy link
Copy Markdown
Contributor Author

can we please check run ci one more time please @alishaz-polymath

@alishaz-polymath alishaz-polymath added run-ci Approve CI to run for external contributors and removed run-ci Approve CI to run for external contributors labels Jan 30, 2026
@hackice20
Copy link
Copy Markdown
Contributor Author

hackice20 commented Jan 31, 2026

Hello @alishaz-polymath sorry to bother you again and again, was looking if

 // Dynamic group events don't have restriction schedules configured
      restrictionScheduleId: null,
      useBookerTimezone: false,

in the getPublicEvent.ts file will this work ?

@alishaz-polymath alishaz-polymath added run-ci Approve CI to run for external contributors and removed run-ci Approve CI to run for external contributors labels Feb 2, 2026
@alishaz-polymath
Copy link
Copy Markdown
Member

Tests still failing, I'm taking it forward here: #27491

Thank you for your PR and efforts 🙏

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

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync ✅ good first issue Good for newcomers High priority Created by Linear-GitHub Sync ⚡ Quick Wins A collection of quick wins/quick fixes that are less than 30 minutes of work ready-for-e2e 💰 Rewarded Rewarded bounties on Algora.io run-ci Approve CI to run for external contributors size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upon changing timezone, we need to update slots when restrictionSchedule is being used with useBookerTimezone enabled

9 participants