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

WIP-reschedule-on-booking-with-seats

Open alannnc opened this issue 1 year ago • 4 comments

What does this PR do?

  • Add new table bookingSeatsReferences that saves every data of the new attendee in a new row so it can be linked to a single booking. This data wasn't being saved anywhere.
  • Book page can now receive a rescheduleUid as a uniqueAttendeeId too that links to a bookingSeatReference
  • Reschedule logic for booking with seats
  • Adds test to reschedule with seats

Fixes #5340

Environment: Staging(main branch) / Production

Type of change

  • [X] Bug fix (non-breaking change which fixes an issue)
  • [X] Chore (refactoring code, technical debt, workflow improvements)

How should this be tested?

  • [ ] Test A
  • [ ] Test B

Checklist

  • I haven't performed a self-review of my own code and corrected any misspellings
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings
  • I haven't checked if new and existing unit tests pass locally with my changes

alannnc avatar Nov 08 '22 20:11 alannnc

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
cal ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 14, 2023 at 4:09AM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
ui ⬜️ Ignored (Inspect) Visit Preview Mar 14, 2023 at 4:09AM (UTC)

vercel[bot] avatar Nov 08 '22 20:11 vercel[bot]

  • Reschedule logic for booking with seats
  • Fixing rescheduling bug when attendee is not the last one in a booking with seats (attendees were being removed from event calendar)

what-the-diff[bot] avatar Nov 08 '22 20:11 what-the-diff[bot]

whats needed to leave draft @alannnc @joeauyeung =

PeerRich avatar Feb 08 '23 12:02 PeerRich

whats needed to leave draft @alannnc @joeauyeung =

There was a few bug to resolve and we probably ditch this PR in favour or @joeauyeung's that he's handling other issues.

alannnc avatar Feb 09 '23 23:02 alannnc

📦 Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 210.42 KB (🟡 +3 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Fifty-seven 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)
/[user] 111.2 KB 321.62 KB 91.89% (🟡 +0.01%)
/[user]/[type] 99.81 KB 310.23 KB 88.64% (🟡 +0.07%)
/[user]/[type]/embed 99.83 KB 310.26 KB 88.64% (🟡 +0.08%)
/[user]/book 188.54 KB 398.97 KB 113.99% (🟡 +0.03%)
/[user]/embed 111.26 KB 321.69 KB 91.91% (🟡 +0.01%)
/apps 170.85 KB 381.27 KB 108.93% (🟡 +0.01%)
/apps/[slug] 194.47 KB 404.89 KB 115.68% (🟡 +0.01%)
/apps/[slug]/[...pages] 394.96 KB 605.38 KB 172.97% (🟡 +0.01%)
/apps/categories 155.75 KB 366.17 KB 104.62% (🟡 +0.01%)
/apps/categories/[category] 159.61 KB 370.03 KB 105.72% (🟡 +0.01%)
/apps/installed/[category] 198.82 KB 409.24 KB 116.93% (+/- <0.01%)
/auth/setup 103.46 KB 313.88 KB 89.68% (🟡 +0.01%)
/availability 158.95 KB 369.38 KB 105.54% (+/- <0.01%)
/availability/[schedule] 271.89 KB 482.31 KB 137.80% (🟡 +0.01%)
/availability/troubleshoot 156.43 KB 366.85 KB 104.82% (+/- <0.01%)
/booking/[uid] 131.36 KB 341.79 KB 97.65% (🟡 +0.04%)
/bookings/[status] 266.18 KB 476.61 KB 136.17% (🟡 +0.04%)
/d/[link]/[slug] 99.46 KB 309.88 KB 88.54% (🟡 +0.07%)
/d/[link]/[slug]/embed 99.49 KB 309.91 KB 88.55% (🟡 +0.07%)
/d/[link]/book 188.2 KB 398.62 KB 113.89% (🟡 +0.03%)
/event-types 351.76 KB 562.19 KB 160.62% (🟡 +0.02%)
/event-types/[type] 384.9 KB 595.33 KB 170.09% (🟡 +0.02%)
/more 155.37 KB 365.79 KB 104.51% (🟡 +0.01%)
/payment/[uid] 68.69 KB 279.11 KB 79.74% (🟡 +0.01%)
/settings/admin 160.8 KB 371.22 KB 106.06% (🟡 +0.01%)
/settings/admin/apps 193.7 KB 404.12 KB 115.46% (🟡 +0.01%)
/settings/admin/apps/[category] 193.68 KB 404.11 KB 115.46% (🟡 +0.01%)
/settings/admin/impersonation 161.08 KB 371.5 KB 106.14% (🟡 +0.01%)
/settings/billing 160.99 KB 371.42 KB 106.12% (🟡 +0.01%)
/settings/developer/api-keys 190.06 KB 400.48 KB 114.42% (🟡 +0.01%)
/settings/developer/webhooks 163.4 KB 373.82 KB 106.81% (🟡 +0.01%)
/settings/developer/webhooks/[id] 192.25 KB 402.68 KB 115.05% (🟡 +0.01%)
/settings/developer/webhooks/new 192.11 KB 402.53 KB 115.01% (🟡 +0.01%)
/settings/my-account/appearance 174.87 KB 385.3 KB 110.08% (🟡 +0.01%)
/settings/my-account/calendars 193.18 KB 403.6 KB 115.32% (+/- <0.01%)
/settings/my-account/conferencing 166.68 KB 377.1 KB 107.74% (🟡 +0.01%)
/settings/my-account/general 266.08 KB 476.5 KB 136.14% (🟡 +0.01%)
/settings/my-account/profile 428 KB 638.42 KB 182.41% (+/- <0.01%)
/settings/security/impersonation 162.95 KB 373.37 KB 106.68% (🟡 +0.01%)
/settings/security/password 194.22 KB 404.64 KB 115.61% (🟡 +0.02%)
/settings/security/sso 170.62 KB 381.05 KB 108.87% (🟡 +0.01%)
/settings/security/two-factor-auth 165.4 KB 375.82 KB 107.38% (🟡 +0.01%)
/settings/teams 160.54 KB 370.96 KB 105.99% (🟡 +0.01%)
/settings/teams/[id]/appearance 174.9 KB 385.32 KB 110.09% (🟡 +0.01%)
/settings/teams/[id]/billing 160.78 KB 371.2 KB 106.06% (🟡 +0.01%)
/settings/teams/[id]/members 297.7 KB 508.12 KB 145.18% (🟡 +0.01%)
/settings/teams/[id]/profile 273.18 KB 483.6 KB 138.17% (🟡 +0.01%)
/settings/teams/[id]/sso 170.72 KB 381.14 KB 108.90% (🟡 +0.01%)
/settings/teams/new 113.37 KB 323.79 KB 92.51% (🟡 +0.01%)
/team/[slug] 113.82 KB 324.25 KB 92.64% (🟡 +0.02%)
/team/[slug]/[type] 99.46 KB 309.88 KB 88.54% (🟡 +0.07%)
/team/[slug]/[type]/embed 99.49 KB 309.91 KB 88.55% (🟡 +0.07%)
/team/[slug]/book 188.2 KB 398.62 KB 113.89% (🟡 +0.03%)
/team/[slug]/embed 113.89 KB 324.31 KB 92.66% (🟡 +0.01%)
/teams 155.59 KB 366.01 KB 104.57% (🟡 +0.01%)
/workflows 168.49 KB 378.91 KB 108.26% (🟡 +0.01%)
/workflows/[workflow] 296.35 KB 506.78 KB 144.79% (🟡 +0.02%)
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 Feb 15 '23 00:02 github-actions[bot]

I found some weird behavior

image image

So far the booking got through normally

Then I've rescheduled from 20 to 27 at the same hour:

image

And three weird things happened:

  1. The previous booking did changed (which IDK if it's expected) image
  2. In my upcoming bookings I should only see the 27th one but the 20th one is still there image
  3. Clicking on the 20th one takes me to a new UID that is neither the original one nor the rescheduled one: image

zomars avatar Feb 15 '23 19:02 zomars

  • Book a seated event twice
  • Cancel OR Reschedule one of them
  • The cancelled seat doesn't become available again: image

zomars avatar Feb 15 '23 19:02 zomars

@zomars & any reviews, just a heads up, I'm working on a PR that branches from this one. It fixes a lot of bugs with this PR. #6858

joeauyeung avatar Feb 15 '23 19:02 joeauyeung

Deployment failed with the following error:

Was unable to schedule a deployment.

vercel[bot] avatar Feb 28 '23 16:02 vercel[bot]

Deployment failed with the following error:

Creating the Deployment Timed Out.

vercel[bot] avatar Feb 28 '23 16:02 vercel[bot]

We have some legit E2E errors to fix first:

image

zomars avatar Feb 28 '23 21:02 zomars

We have some legit E2E errors to fix first:

image

I think we are blocked on this while we fix TZ issue.

alannnc avatar Mar 02 '23 00:03 alannnc

Current Playwright Test Results Summary

✅ 59 Passing - ❌ 3 Failing

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 03/14/2023 04:18:32am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 27d60aa09761e880cc8e79b3d394d68fe7d5862f

Started: 03/14/2023 04:13:22am UTC

❌ Failures

📄   ../tests/action-based.test.ts • 3 Failures

Top 1 Common Error Messages

Expected to provide an iframe, got null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should open embed iframe on click - Configured with light theme
Retry 1Initial Attempt
Error: Expected to provide an iframe, got null
Expected to provide an iframe, got null
47.66% (51) 51 / 107 runs
failed over last 7 days
0% (0) 0 / 107 runs
flaked over last 7 days
Popup Tests should be able to reschedule
Retry 1Initial Attempt
Error: Expected to provide an iframe, got null
Expected to provide an iframe, got null
47.66% (51) 51 / 107 runs
failed over last 7 days
0% (0) 0 / 107 runs
flaked over last 7 days
Popup Tests should open Routing Forms embed on click
Retry 1Initial Attempt
Error: Routing Form embed iframe not found
Routing Form embed iframe not found
47.66% (51) 51 / 107 runs
failed over last 7 days
0% (0) 0 / 107 runs
flaked over last 7 days

View Detailed Build Results


deploysentinel[bot] avatar Mar 03 '23 16:03 deploysentinel[bot]

I'm getting this error..

imagen

roae avatar Mar 03 '23 19:03 roae

I'm getting this error..

imagen

@joeauyeung This is what I'm getting too, looking into it.

alannnc avatar Mar 03 '23 20:03 alannnc

After having booked Seat one, it still shows 2 / 2: image

Edit: This happens only if you refresh the page after clicking back, if you click on the availability page to go to the booking page it is properly updated.

emrysal avatar Mar 13 '23 17:03 emrysal

image

This could be correct, I have booking entries per each seat.

emrysal avatar Mar 13 '23 17:03 emrysal

@emrysal Yeah it's part of the same bug I think, right now it's creating 2 booking when it should be one with many bookingSeats.

alannnc avatar Mar 13 '23 20:03 alannnc