Skip to content
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

fix: rescheduling recurring events #12567

Merged
merged 5 commits into from
Nov 30, 2023

Conversation

SomayChauhan
Copy link
Member

@SomayChauhan SomayChauhan commented Nov 28, 2023

What does this PR do?

an attempt to fix #12461

Before

Screencast.from.28-11-23.12.22.58.PM.IST.webm
  1. Create a recurring event.
  2. Book the recurring event, choosing to repeat every week for 2 occurrences.
  3. Observe how two bookings appear on the table for the user and in the upcoming bookings page.
  4. Attempt to reschedule the second booking. However, instead of only rescheduling that specific booking, it shows a recurrence every week for 12 occurrences. Additionally, selecting a time attempts to reschedule/book the entire 12 weeks, whereas the intention was to reschedule only that one booking.
  5. Notice the creation of new bookings in the upcoming bookings page and in the database as well

After

Screencast.from.28-11-23.11.48.51.AM.IST.webm

The fix ensures that rescheduling a single booking in recurring-bookings behaves like rescheduling a normal booking.

Not confident if this is the right approach

Copy link

vercel bot commented Nov 28, 2023

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

A member of the Team first needs to authorize it.

@github-actions github-actions bot added bookings area: bookings, availability, timezones, double booking High priority Created by Linear-GitHub Sync recurring events Created by Linear-GitHub Sync 🐛 bug Something isn't working labels Nov 28, 2023
Copy link
Contributor

github-actions bot commented Nov 28, 2023

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link to collect XP and win prizes!

Copy link
Contributor

github-actions bot commented Nov 28, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

Fifty-four 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 277.77 KB 441.21 KB 126.06% (🟡 +3.03%)
/apps/[slug] 295.43 KB 458.88 KB 131.11% (🟡 +2.90%)
/apps/[slug]/[...pages] 552.87 KB 716.32 KB 204.66% (🟡 +3.00%)
/apps/categories 255.7 KB 419.15 KB 119.76% (🟡 +3.05%)
/apps/categories/[category] 259.9 KB 423.35 KB 120.96% (🟡 +2.91%)
/apps/installed/[category] 278.83 KB 442.28 KB 126.37% (🟡 +2.74%)
/availability 393.32 KB 556.77 KB 159.08% (🟡 +3.02%)
/availability/[schedule] 359.22 KB 522.67 KB 149.33% (🟡 +3.03%)
/availability/troubleshoot 280.88 KB 444.33 KB 126.95% (🟡 +3.02%)
/bookings/[status] 325.25 KB 488.69 KB 139.63% (🟡 +2.98%)
/enterprise 256.16 KB 419.61 KB 119.89% (🟡 +3.05%)
/event-types 551.29 KB 714.73 KB 204.21% (🟡 +2.98%)
/event-types/[type] 427.42 KB 590.86 KB 168.82% (🟡 +2.78%)
/getting-started/[[...step]] 399.89 KB 563.34 KB 160.95% (🟢 -0.32%)
/insights 481.66 KB 645.11 KB 184.32% (🟡 +3.00%)
/more 255.34 KB 418.78 KB 119.65% (🟡 +3.05%)
/settings/admin 261.98 KB 425.43 KB 121.55% (🟡 +3.05%)
/settings/admin/apps 274.99 KB 438.44 KB 125.27% (🟡 +3.00%)
/settings/admin/apps/[category] 274.98 KB 438.43 KB 125.26% (🟡 +3.00%)
/settings/admin/flags 265.63 KB 429.07 KB 122.59% (🟡 +3.02%)
/settings/admin/impersonation 262.25 KB 425.7 KB 121.63% (🟡 +3.05%)
/settings/admin/organizations 263.28 KB 426.73 KB 121.92% (🟡 +3.05%)
/settings/admin/users 264.2 KB 427.65 KB 122.19% (🟡 +3.05%)
/settings/admin/users/[id]/edit 352.86 KB 516.31 KB 147.52% (🟢 -0.15%)
/settings/admin/users/add 352.6 KB 516.04 KB 147.44% (🟢 -0.15%)
/settings/billing 262.19 KB 425.64 KB 121.61% (🟡 +3.05%)
/settings/developer/api-keys 266.49 KB 429.94 KB 122.84% (🟡 +3.02%)
/settings/developer/webhooks 266.42 KB 429.86 KB 122.82% (🟡 +3.02%)
/settings/developer/webhooks/[id] 267.23 KB 430.68 KB 123.05% (🟡 +2.86%)
/settings/developer/webhooks/new 267.27 KB 430.72 KB 123.06% (🟡 +2.86%)
/settings/my-account/appearance 285.48 KB 448.93 KB 128.27% (🟡 +3.02%)
/settings/my-account/calendars 268.88 KB 432.32 KB 123.52% (🟡 +1.64%)
/settings/my-account/conferencing 273.6 KB 437.05 KB 124.87% (🟡 +2.91%)
/settings/my-account/general 350.18 KB 513.63 KB 146.75% (🟡 +2.99%)
/settings/organizations/appearance 274.49 KB 437.94 KB 125.13% (🟡 +3.02%)
/settings/organizations/billing 262.23 KB 425.67 KB 121.62% (🟡 +3.05%)
/settings/organizations/general 342.9 KB 506.34 KB 144.67% (🟡 +3.05%)
/settings/organizations/teams/other 263.06 KB 426.51 KB 121.86% (🟡 +3.05%)
/settings/organizations/teams/other/[id]/appearance 274.58 KB 438.03 KB 125.15% (🟡 +3.02%)
/settings/organizations/teams/other/[id]/members 268.96 KB 432.4 KB 123.54% (🟡 +3.03%)
/settings/security/impersonation 267.18 KB 430.62 KB 123.03% (🟡 +3.03%)
/settings/security/password 275.95 KB 439.4 KB 125.54% (🟡 +3.02%)
/settings/security/sso 271.23 KB 434.68 KB 124.19% (🟡 +3.05%)
/settings/security/two-factor-auth 271.02 KB 434.47 KB 124.13% (🟡 +3.03%)
/settings/teams 261.73 KB 425.17 KB 121.48% (🟡 +3.05%)
/settings/teams/[id]/appearance 274.57 KB 438.02 KB 125.15% (🟡 +3.02%)
/settings/teams/[id]/billing 262.23 KB 425.67 KB 121.62% (🟡 +3.05%)
/settings/teams/[id]/members 387.87 KB 551.32 KB 157.52% (🟡 +3.02%)
/settings/teams/[id]/onboard-members 154.93 KB 318.38 KB 90.96% (🟢 -0.16%)
/settings/teams/[id]/sso 271.75 KB 435.2 KB 124.34% (🟡 +3.05%)
/settings/teams/new 192.3 KB 355.75 KB 101.64% (🟡 +3.06%)
/teams 255.61 KB 419.06 KB 119.73% (🟡 +3.05%)
/workflows 293.64 KB 457.09 KB 130.60% (🟡 +3.03%)
/workflows/[workflow] 407 KB 570.44 KB 162.98% (🟡 +3.03%)
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 "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@SomayChauhan SomayChauhan marked this pull request as ready for review November 29, 2023 05:40
export const EventDetails = ({
event,
blocks = defaultEventDetailsBlocks,
rescheduleUid,
Copy link
Member

Choose a reason for hiding this comment

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

Can't we just use

const rescheduleUid = useBookerStore((state) => state.rescheduleUid);

In here instead of doing prop-drilling?

https://handbook.cal.com/engineering/best-practices/avoid-prop-drilling

Copy link
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

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

I tested it and it looked pretty good. The only thing I found was that the old rescheduled booking is still showing up on the booking detail page of the recurring event (booking/). @SomayChauhan Could you take a look at that?

SomayChauhan

This comment was marked as duplicate.

Copy link
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

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

Great fix, thank you 🙏

@CarinaWolli CarinaWolli merged commit 1c20bdc into calcom:main Nov 30, 2023
32 of 39 checks passed
jakazzy pushed a commit to jakazzy/cal.com that referenced this pull request Dec 5, 2023
hbjORbj pushed a commit to codemod-com/cal.com-demo that referenced this pull request Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookings area: bookings, availability, timezones, double booking 🐛 bug Something isn't working High priority Created by Linear-GitHub Sync recurring events Created by Linear-GitHub Sync
Projects
None yet
3 participants