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: Send responses in confirm booking flow #7830

Merged

Conversation

hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Mar 20, 2023

What does this PR do?

Fixes #7810

Environment: Production

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • Make a booking for an Event Type which requires confirmation. Accept the booking and notice that webhook payload has the responses and userFieldsResponses props.
  • Make a booking like the earlier test and before accepting the booking, delete the Event Type. Notice that responses and userFieldsResponses props are still there.

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

@linear
Copy link

linear bot commented Mar 20, 2023

CAL-1287 Differing webhook responses when using "requires confirmation"

Hey guys not sure if you're aware of this issue with the booking creation webhook payload. Everything works great when a normal booking is completed, all custom input responses come through as expected. However, when I change the booking to "Required Confirmation" I don't get the same payload data and am missing some important custom input responses.

Please see the images below and you'll notice "responses" is completely missing when "Require Confirmation" is activated.

@vercel
Copy link

vercel bot commented Mar 20, 2023

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 21, 2023 at 8:16AM (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 21, 2023 at 8:16AM (UTC)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2023

📦 Next.js Bundle Analysis

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

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 210.79 KB (🟢 -97 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!

Sixty-nine 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)
/404 8.34 KB 219.12 KB 62.61% (🟢 -0.01%)
/[user] 111.3 KB 322.09 KB 92.02% (+/- <0.01%)
/[user]/[type] 99.79 KB 310.58 KB 88.74% (🟢 -0.01%)
/[user]/[type]/embed 99.81 KB 310.6 KB 88.74% (+/- <0.01%)
/[user]/book 188.91 KB 399.7 KB 114.20% (🟢 -0.55%)
/[user]/embed 111.37 KB 322.15 KB 92.04% (+/- <0.01%)
/apps 171 KB 381.79 KB 109.08% (+/- <0.01%)
/apps/[slug] 194.73 KB 405.51 KB 115.86% (🟢 -0.01%)
/apps/[slug]/[...pages] 395.14 KB 605.92 KB 173.12% (🟢 -0.35%)
/apps/[slug]/setup 923 B 211.69 KB 60.48% (+/- <0.01%)
/apps/categories 155.91 KB 366.7 KB 104.77% (🟢 -0.01%)
/apps/categories/[category] 159.77 KB 370.56 KB 105.87% (+/- <0.01%)
/apps/installed/[category] 198.92 KB 409.71 KB 117.06% (🟢 -0.58%)
/auth/error 19.21 KB 230 KB 65.71% (+/- <0.01%)
/auth/forgot-password 25.55 KB 236.34 KB 67.53% (🟢 -0.01%)
/auth/forgot-password/[id] 40.87 KB 251.66 KB 71.90% (+/- <0.01%)
/auth/login 40.03 KB 250.81 KB 71.66% (🟢 -0.01%)
/auth/logout 7.53 KB 218.32 KB 62.38% (🟢 -0.01%)
/auth/setup 103.48 KB 314.27 KB 89.79% (+/- <0.01%)
/availability 159.12 KB 369.9 KB 105.69% (🟢 -0.01%)
/availability/[schedule] 271.94 KB 482.73 KB 137.92% (🟢 -1.13%)
/availability/troubleshoot 156.59 KB 367.38 KB 104.97% (🟢 -0.01%)
/booking/[uid] 131.39 KB 342.18 KB 97.76% (+/- <0.01%)
/bookings/[status] 266.25 KB 477.04 KB 136.30% (🟢 -0.74%)
/d/[link]/[slug] 99.44 KB 310.23 KB 88.64% (🟢 -0.01%)
/d/[link]/[slug]/embed 99.47 KB 310.25 KB 88.64% (+/- <0.01%)
/d/[link]/book 188.57 KB 399.36 KB 114.10% (🟢 -0.55%)
/event-types 351.94 KB 562.72 KB 160.78% (🟢 -0.52%)
/event-types/[type] 385.07 KB 595.86 KB 170.24% (🟢 -0.38%)
/getting-started/[[...step]] 329.65 KB 540.44 KB 154.41% (🟢 -1.12%)
/more 155.53 KB 366.32 KB 104.66% (+/- <0.01%)
/settings/admin 160.96 KB 371.74 KB 106.21% (🟢 -0.01%)
/settings/admin/apps 193.86 KB 404.65 KB 115.61% (🟢 -0.01%)
/settings/admin/apps/[category] 193.84 KB 404.63 KB 115.61% (🟢 -0.01%)
/settings/admin/impersonation 161.24 KB 372.03 KB 106.29% (🟢 -0.01%)
/settings/billing 161.15 KB 371.94 KB 106.27% (🟢 -0.01%)
/settings/developer/api-keys 190.22 KB 401.01 KB 114.57% (🟢 -0.01%)
/settings/developer/webhooks 163.56 KB 374.35 KB 106.96% (🟢 -0.01%)
/settings/developer/webhooks/[id] 192.41 KB 403.2 KB 115.20% (🟢 -0.58%)
/settings/developer/webhooks/new 192.27 KB 403.06 KB 115.16% (🟢 -0.58%)
/settings/my-account/appearance 175.03 KB 385.82 KB 110.23% (🟢 -0.01%)
/settings/my-account/calendars 193.29 KB 404.07 KB 115.45% (🟢 -0.58%)
/settings/my-account/conferencing 166.83 KB 377.62 KB 107.89% (🟢 -0.01%)
/settings/my-account/general 266.24 KB 477.03 KB 136.29% (🟢 -1.12%)
/settings/my-account/profile 428.16 KB 638.95 KB 182.56% (🟢 -0.01%)
/settings/security/impersonation 163.11 KB 373.9 KB 106.83% (🟢 -0.01%)
/settings/security/password 194.4 KB 405.19 KB 115.77% (🟢 -0.58%)
/settings/security/sso 170.8 KB 381.59 KB 109.03% (🟢 -0.02%)
/settings/security/two-factor-auth 165.56 KB 376.35 KB 107.53% (🟢 -0.01%)
/settings/teams 160.7 KB 371.49 KB 106.14% (🟢 -0.01%)
/settings/teams/[id]/appearance 175.05 KB 385.84 KB 110.24% (🟢 -0.01%)
/settings/teams/[id]/billing 160.94 KB 371.72 KB 106.21% (🟢 -0.01%)
/settings/teams/[id]/members 297.72 KB 508.51 KB 145.29% (🟢 -1.12%)
/settings/teams/[id]/onboard-members 74.11 KB 284.9 KB 81.40% (+/- <0.01%)
/settings/teams/[id]/profile 273.34 KB 484.13 KB 138.32% (🟢 -0.01%)
/settings/teams/[id]/sso 170.9 KB 381.68 KB 109.05% (🟢 -0.01%)
/settings/teams/new 113.4 KB 324.19 KB 92.63% (🟢 -0.01%)
/signup 25.42 KB 236.21 KB 67.49% (🟢 -0.01%)
/team/[slug] 113.86 KB 324.64 KB 92.76% (🟢 -0.01%)
/team/[slug]/[type] 99.44 KB 310.23 KB 88.64% (🟢 -0.01%)
/team/[slug]/[type]/embed 99.47 KB 310.26 KB 88.65% (🟢 -0.01%)
/team/[slug]/book 188.57 KB 399.36 KB 114.10% (🟢 -0.55%)
/team/[slug]/embed 113.92 KB 324.71 KB 92.77% (+/- <0.01%)
/teams 155.75 KB 366.54 KB 104.73% (🟢 -0.01%)
/video/meeting-ended/[uid] 22.74 KB 233.53 KB 66.72% (+/- <0.01%)
/video/meeting-not-started/[uid] 22.38 KB 233.17 KB 66.62% (🟢 -0.01%)
/video/no-meeting-found 6.57 KB 217.36 KB 62.10% (+/- <0.01%)
/workflows 168.65 KB 379.44 KB 108.41% (🟢 -0.01%)
/workflows/[workflow] 296.53 KB 507.32 KB 144.95% (🟢 -0.56%)
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.

@deploysentinel
Copy link

deploysentinel bot commented Mar 20, 2023

Current Playwright Test Results Summary

✅ 66 Passing - ⚠️ 1 Flaky

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

(Last updated on 03/21/2023 08:27:22am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: e24626a

Started: 03/21/2023 08:22:39am UTC

⚠️ Flakes

📄   apps/web/playwright/embed-code-generator.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Embed Code Generator Tests Event Type Edit Page open Embed Dialog for the Event Type
Retry 1Initial Attempt
4.35% (10) 10 / 230 runs
failed over last 7 days
10.87% (25) 25 / 230 runs
flaked over last 7 days

View Detailed Build Results


}),
]);

export const bookingResponsesDbSchema = z.record(bookingResponse);
Copy link
Member Author

Choose a reason for hiding this comment

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

It allows disconnecting current event type data from the responses collected. It thus fixes scenarios like

  • Earlier, a field was of type text and has value "Test" and when we changed the type to "checkbox" booking started showing the value as false
  • Earlier, a field was there and was recorded in a booking but after removing that field/question, it stopped showing in existing bookings as well.

@@ -765,6 +773,22 @@ export const bookingsRouter = router({
scheduledJobs: true,
},
});

const bookingFields = bookingRaw.eventType
Copy link
Member Author

Choose a reason for hiding this comment

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

If eventType has been deleted and then booking is being confirmed, there are no bookingFields.

@hariombalhara hariombalhara force-pushed the hariom/cal-1287-differing-webhook-responses-when-using branch from dec7d78 to e24626a Compare March 21, 2023 08:10
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.

Nice! Works and code looks good as well 🙏

@hariombalhara hariombalhara merged commit a8825ba into main Mar 27, 2023
@hariombalhara hariombalhara deleted the hariom/cal-1287-differing-webhook-responses-when-using branch March 27, 2023 08:27
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-1287] Differing webhook responses when using "requires confirmation"
3 participants