cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

fix: incorrect booking seats full error on collective seated event

Open kart1ka opened this issue 1 year ago • 3 comments

What does this PR do?

This issue occurs because the backend compares the total number of attendees (team members + booked seats) to the total number of seats per slot, instead of comparing the actual booked seats to the total number of seats per slot.

  • Fixes #15600 (GitHub issue number)
  • Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

https://www.loom.com/share/ff752121048b4e18a1ad64026963347d?sid=6686b5a4-d39f-4019-8122-c27630ae66db

Mandatory Tasks (DO NOT REMOVE)

  • [x] I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • [ ] I have added a Docs issue here 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 a collective team seated event with a total of 3 seats.
  2. Assign 3 team members to attend the event.
  3. Book 1 seat for the event.
  4. Attempt to book an additional seat for the same slot.
  5. Notice the second booking is successful.

kart1ka avatar Jun 27 '24 17:06 kart1ka

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

A member of the Team first needs to authorize it.

vercel[bot] avatar Jun 27 '24 17:06 vercel[bot]

Graphite Automations

"Add community label" took an action on this PR • (06/27/24)

1 label was added to this PR based on Keith Williams's automation.

"Add consumer team as reviewer" took an action on this PR • (06/27/24)

1 reviewer was added to this PR based on Keith Williams's automation.

graphite-app[bot] avatar Jun 27 '24 17:06 graphite-app[bot]

@kart1ka Could you also add unit tests for this bug fix?

Hi @Udit-takkar

I have added the unit test.

kart1ka avatar Jun 30 '24 15:06 kart1ka

📦 Next.js Bundle Analysis for @calcom/web

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

Eighty-one 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 278.92 KB 506.53 KB 144.72% (🟢 -1.50%)
/apps/[slug] 296.49 KB 524.1 KB 149.74% (🟢 -1.51%)
/apps/[slug]/[...pages] 588.59 KB 816.2 KB 233.20% (🟢 -1.16%)
/apps/categories 256.24 KB 483.85 KB 138.24% (🟢 -1.23%)
/apps/categories/[category] 261.05 KB 488.66 KB 139.62% (🟢 -1.50%)
/apps/installation/[[...step]] 468.97 KB 696.58 KB 199.02% (🔴 +86.09%)
/apps/installed/[category] 278.19 KB 505.8 KB 144.51% (🟢 -1.83%)
/auth/saml-idp 12.22 KB 239.83 KB 68.52% (🟢 -20.80%)
/auth/setup 150.97 KB 378.58 KB 108.17% (🟡 +0.26%)
/availability 426.14 KB 653.75 KB 186.79% (🟢 -1.80%)
/availability/[schedule] 410.56 KB 638.17 KB 182.33% (🟢 -1.64%)
/bookings/[status] 326.17 KB 553.78 KB 158.22% (🟢 -1.15%)
/enterprise 256.3 KB 483.91 KB 138.26% (🟢 -1.23%)
/event-types 561.25 KB 788.86 KB 225.39% (🟢 -1.18%)
/event-types/[type] 437.8 KB 665.41 KB 190.12% (🟢 -1.07%)
/getting-started/[[...step]] 409.73 KB 637.34 KB 182.10% (🟢 -0.25%)
/insights 474.65 KB 702.26 KB 200.65% (🟢 -1.69%)
/more 255.8 KB 483.41 KB 138.12% (🟢 -1.23%)
/settings/admin 262.24 KB 489.85 KB 139.96% (🟢 -1.22%)
/settings/admin/apps 275.48 KB 503.09 KB 143.74% (🟢 -1.24%)
/settings/admin/apps/[category] 275.47 KB 503.08 KB 143.74% (🟢 -1.25%)
/settings/admin/flags 265.96 KB 493.57 KB 141.02% (🟢 -1.25%)
/settings/admin/impersonation 262.63 KB 490.24 KB 140.07% (🟢 -1.22%)
/settings/admin/lockedSMS 283.73 KB 511.34 KB 146.10% (🟢 -1.19%)
/settings/admin/oAuth 274.24 KB 501.85 KB 143.38% (🟢 -1.24%)
/settings/admin/orgMigrations/_OrgMigrationLayout 251.17 KB 478.78 KB 136.79% (🟢 -1.21%)
/settings/admin/orgMigrations/moveTeamToOrg 300.91 KB 528.52 KB 151.00% (🟢 -1.20%)
/settings/admin/orgMigrations/moveUserToOrg 320.74 KB 548.35 KB 156.67% (🟢 -1.17%)
/settings/admin/orgMigrations/removeTeamFromOrg 300.67 KB 528.28 KB 150.94% (🟢 -1.20%)
/settings/admin/orgMigrations/removeUserFromOrg 300.68 KB 528.29 KB 150.94% (🟢 -1.20%)
/settings/admin/organizations 264.13 KB 491.74 KB 140.50% (🟢 -1.22%)
/settings/admin/organizations/[id]/edit 262.79 KB 490.4 KB 140.11% (🟢 -1.21%)
/settings/admin/users 264.9 KB 492.51 KB 140.72% (🟢 -1.22%)
/settings/admin/users/[id]/edit 393.96 KB 621.57 KB 177.59% (🟢 -1.22%)
/settings/admin/users/add 393.62 KB 621.23 KB 177.50% (🟢 -1.22%)
/settings/billing 262.45 KB 490.06 KB 140.02% (🟢 -1.22%)
/settings/developer/api-keys 266.73 KB 494.34 KB 141.24% (🟢 -1.25%)
/settings/developer/webhooks 266.91 KB 494.52 KB 141.29% (🟢 -1.24%)
/settings/developer/webhooks/[id] 267.89 KB 495.5 KB 141.57% (🟢 -1.23%)
/settings/developer/webhooks/new 267.91 KB 495.52 KB 141.58% (🟢 -1.23%)
/settings/my-account/appearance 314.33 KB 541.94 KB 154.84% (🟢 -1.53%)
/settings/my-account/calendars 274.21 KB 501.82 KB 143.38% (🟢 -1.16%)
/settings/my-account/conferencing 272.2 KB 499.81 KB 142.80% (🟢 -1.98%)
/settings/my-account/general 377.85 KB 605.46 KB 172.99% (🟢 -1.24%)
/settings/my-account/out-of-office 267.37 KB 494.98 KB 141.42% (🟢 -1.24%)
/settings/my-account/profile 410.28 KB 637.89 KB 182.25% (🟢 -1.23%)
/settings/organizations/[id]/about 159.66 KB 387.27 KB 110.65% (🟡 +0.47%)
/settings/organizations/[id]/add-teams 159.65 KB 387.26 KB 110.65% (🟡 +0.47%)
/settings/organizations/admin-api 262.4 KB 490.01 KB 140.00% (🟢 -1.21%)
/settings/organizations/appearance 122.34 KB 349.95 KB 99.99% (🟢 -48.03%)
/settings/organizations/billing 262.48 KB 490.09 KB 140.03% (🟢 -1.22%)
/settings/organizations/dsync 295.1 KB 522.71 KB 149.35% (🟢 -1.22%)
/settings/organizations/general 350.69 KB 578.3 KB 165.23% (🟢 -1.24%)
/settings/organizations/members 400.51 KB 628.12 KB 179.46% (🟢 -1.62%)
/settings/organizations/new 159.66 KB 387.27 KB 110.65% (🟡 +0.47%)
/settings/organizations/privacy 267.89 KB 495.5 KB 141.57% (🟢 -1.24%)
/settings/organizations/profile 415.16 KB 642.77 KB 183.65% (🟡 +2.29%)
/settings/organizations/sso 273.07 KB 500.68 KB 143.05% (🟢 -1.21%)
/settings/organizations/teams/other 263.31 KB 490.92 KB 140.26% (🟢 -1.21%)
/settings/organizations/teams/other/[id]/appearance 275.11 KB 502.72 KB 143.64% (🟢 -1.20%)
/settings/organizations/teams/other/[id]/members 269.8 KB 497.41 KB 142.12% (🟢 -1.25%)
/settings/organizations/teams/other/[id]/profile 473.52 KB 701.13 KB 200.32% (🟢 -1.24%)
/settings/platform 260.9 KB 488.51 KB 139.58% (🟢 -1.23%)
/settings/platform/new 120.67 KB 348.28 KB 99.51% (🟡 +0.51%)
/settings/platform/oauth-clients/[clientId]/edit 259.21 KB 486.82 KB 139.09% (🟢 -1.23%)
/settings/platform/oauth-clients/create 258.35 KB 485.96 KB 138.85% (🟢 -1.23%)
/settings/security/impersonation 267.55 KB 495.16 KB 141.47% (🟢 -1.24%)
/settings/security/password 305.7 KB 533.31 KB 152.37% (🟢 -1.23%)
/settings/security/sso 272.52 KB 500.13 KB 142.89% (🟢 -1.21%)
/settings/security/two-factor-auth 271.03 KB 498.64 KB 142.47% (🟢 -1.25%)
/settings/teams 261.98 KB 489.59 KB 139.88% (🟢 -1.21%)
/settings/teams/[id]/appearance 275.1 KB 502.71 KB 143.63% (🟢 -1.19%)
/settings/teams/[id]/billing 262.48 KB 490.09 KB 140.03% (🟢 -1.22%)
/settings/teams/[id]/members 379.92 KB 607.53 KB 173.58% (🟢 -1.24%)
/settings/teams/[id]/profile 474.3 KB 701.91 KB 200.55% (🟢 -1.24%)
/settings/teams/new 193 KB 420.61 KB 120.17% (🟢 -1.83%)
/teams 256.03 KB 483.64 KB 138.18% (🟢 -1.23%)
/upgrade 256.15 KB 483.76 KB 138.22% (🟢 -1.23%)
/video/[uid] 291.18 KB 518.79 KB 148.23% (🟢 -0.18%)
/workflows 288.06 KB 515.67 KB 147.33% (🟢 -1.17%)
/workflows/[workflow] 414.6 KB 642.21 KB 183.49% (🟢 -1.45%)
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 "+/-

github-actions[bot] avatar Jul 08 '24 16:07 github-actions[bot]