cal.com
cal.com copied to clipboard
Use user profile timezone from DB as fallback for CalDAV all-day events
What does this PR do?
The iCalendar 2.0 specification does not require timezone information for all-day events. All-day events are represented by a date value instead of a date-time value, which means they don't include timezone information. An all-day event is assumed to occur at the same local time across all time zones.
This PR addresses the issue where the tzid is not always present in CalDAV all-day events, as per the iCalendar 2.0 specification. To ensure proper timezone handling, we have made the following changes:
- Added a new function getUserId to safely retrieve the user ID from the selectedCalendars array.
- Fetched the userTimeZone from the user's profile using the obtained user ID.
- Modified the existing code to use the userTimeZone as a fallback when the tzid is missing from the vcalendar events.
By implementing these changes, we ensure that the timezone information is accurately reflected in CalDAV all-day events, even when the timezone data is not explicitly provided within the event itself.
Fixes #8754
Environment: Staging(main branch)
Type of change
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
How should this be tested?
- [ ] Please test an All-Day event with CalDAV connected calendar. The slots should be blocked for the day that's supposed to have the all day event if the Timezone information within the Cal.com profile is the same as the booking page. This is essentially because, as mentioned above, CalDAV all day events do not send timezone information as part of the event details, which means we must fallback to their cal.com profile to fetch nearest accurate timezone information.
Checklist
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| cal | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 10, 2023 8:23am |
| ui | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 10, 2023 8:23am |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| cal | 🔄 Building (Inspect) | May 8, 2023 2:24pm | |
| ui | ✅ Ready (Inspect) | Visit Preview | May 8, 2023 2:24pm |
📦 Next.js Bundle Analysis for @calcom/web
This analysis was generated by the Next.js Bundle Analysis action. 🤖
Three Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
| Page | Size (compressed) | First Load | % of Budget (350 KB) |
|---|---|---|---|
/apps/[slug]/[...pages] |
456.17 KB |
607.02 KB | 173.43% (🟢 -0.16%) |
/auth/setup |
174.09 KB |
324.94 KB | 92.84% (🟢 -0.16%) |
/event-types/[type] |
468.01 KB |
618.86 KB | 176.82% (🟢 -0.20%) |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis
The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/-
Current Playwright Test Results Summary
✅ 98 Passing - ⚠️ 3 Flaky
Run may still be in progress, this comment will be updated as current testing workflow or job completes...
(Last updated on 05/10/2023 08:43:31am UTC)
Run Details
Running Workflow PR Update on Github Actions
Commit: 011bd1471041102f78549c5aef06142fb9453e34
Started: 05/10/2023 08:31:26am UTC
⚠️ Flakes
📄 apps/web/playwright/event-types.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Event Types tests user -- old-booker can add multiple organizer address
Retry 1 • Initial Attempt |
0.40% (1)1 / 252 runfailed over last 7 days |
5.95% (15)15 / 252 runsflaked over last 7 days |
📄 apps/web/playwright/booking-seats.e2e.ts • 2 Flakes
Top 1 Common Error Messages
|
|
2 Test Cases Affected |
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Booking with Seats -- new-booker Reschedule for booking with seats -- old-booker Should reschedule booking with seats and if everyone rescheduled it should be deleted
Retry 1 • Initial Attempt |
0% (0)0 / 262 runsfailed over last 7 days |
19.08% (50)50 / 262 runsflaked over last 7 days |
|
Booking with Seats -- old-booker Reschedule for booking with seats -- old-booker Should reschedule booking with seats and if everyone rescheduled it should be deleted
Retry 1 • Initial Attempt |
0% (0)0 / 259 runsfailed over last 7 days |
6.56% (17)17 / 259 runsflaked over last 7 days |