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

Improvement: Do immediate redirect for "Redirect on Booking" #7947

Merged
merged 3 commits into from
Apr 4, 2023

Conversation

hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Mar 27, 2023

What does this PR do?

  • Do immediate redirect for the success page now for all existing as well as new Event Types.
    Loom Demo
  • Also adds a helper text below "Redirect on Booking" option

Screenshot 2023-03-27 at 5 00 32 PM

Motivation:

  • Most users don't like the waited redirect and they wanted it to be low or either removed.

TODO:

  • Confirm if the helper text in orange looks good. @PeerRich
  • It's going to affect existing event-types for which users might not have configured the custom success page to show a confirmation message. An email has been sent to users.
  • Wait for a week after the email. Waiting for 3rd April

Environment: Production

Type of change

  • New feature (non-breaking change which adds functionality)

How should this be tested?

  • Test that if "Redirect on Booking" is enabled, redirection happens instantly now(without showing the Cal.com success page)
  • Test that cancel page and the booking details page accessible from bookings/upcoming (which is actually booking success page) doesn't do redirect

Checklist

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

@hariombalhara hariombalhara requested a review from a team March 27, 2023 10:48
@vercel
Copy link

vercel bot commented Mar 27, 2023

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 Apr 4, 2023 5:42am
dhe ❌ Failed (Inspect) Apr 4, 2023 5:42am
inkblot ❌ Failed (Inspect) Apr 4, 2023 5:42am
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 4, 2023 5:42am
web ❌ Failed (Inspect) Apr 4, 2023 5:42am

@github-actions
Copy link
Contributor

github-actions bot commented Mar 27, 2023

📦 Next.js Bundle Analysis

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

🎉 Global Bundle Size Decreased

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

Two 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)
/booking/[uid] 123.19 KB 356.52 KB 101.86% (🟢 -0.16%)
/event-types/[type] 381.74 KB 615.07 KB 175.73% (🟢 -0.01%)
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.

{/* Textfield has some margin by default we remove that so we can keep consitant aligment */}
<div className="lg:-ml-2">
{/* Textfield has some margin by default we remove that so we can keep consistent alignment */}
<div className="lg:-ml-2 lg:-mb-2">
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 fixes unnecessary bottom margin because of Input

* Redirects to external URL with query params from current URL.
* Query Params and Hash Fragment if present in external URL are kept intact.
*/
function RedirectionToast({ url }: { url: string }) {
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't do a waited redirect and thus toast isn't required.

@hariombalhara hariombalhara changed the title Do immediate redirect Do immediate redirect for "Redirect on Booking" Mar 27, 2023
@hariombalhara hariombalhara changed the title Do immediate redirect for "Redirect on Booking" Improvement: Do immediate redirect for "Redirect on Booking" Mar 27, 2023
@@ -985,13 +875,6 @@ const getEventTypesFromDB = async (id: number) => {
};
};

const schema = z.object({
Copy link
Member Author

Choose a reason for hiding this comment

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

Removes schema.We use querySchema at both client side and server side now.

@@ -176,13 +68,14 @@ const stringToBoolean = z

const querySchema = z.object({
uid: z.string(),
allRemainingBookings: stringToBoolean,
email: z.string().optional(),
eventTypeSlug: z.string().optional(),
Copy link
Member Author

@hariombalhara hariombalhara Mar 27, 2023

Choose a reason for hiding this comment

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

Add missing eventTypeSlug that wasn't needed at client but was needed at server. It comes from schema variable that has been removed.

@deploysentinel
Copy link

deploysentinel bot commented Mar 27, 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 04/04/2023 05:52:51am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 6aad8ec

Started: 04/04/2023 05:47:41am UTC

⚠️ Flakes

📄   packages/app-store/routing-forms/playwright/tests/basic.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Routing Forms Seeded Routing Form Routing Link - Reporting and CSV Download
Retry 1Initial Attempt
9.03% (13) 13 / 144 runs
failed over last 7 days
26.39% (38) 38 / 144 runs
flaked over last 7 days

View Detailed Build Results


@@ -1121,7 +1004,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
customInputs: customInputSchema.array().parse(eventTypeRaw.customInputs),
};

if (eventType.metadata?.disableSuccessPage && eventType.successRedirectUrl && !cancel) {
if (eventType.successRedirectUrl && isSuccessBookingPage && !cancel) {
Copy link
Member Author

@hariombalhara hariombalhara Mar 27, 2023

Choose a reason for hiding this comment

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

This fixes a bug where if "Disable success Page" was enabled, the user can't see the booking details from bookings/upcoming. The page always redirects to custom success page.

isSuccessBookingPage is true when a booking is done otherwise it's not set.

@emrysal
Copy link
Contributor

emrysal commented Mar 28, 2023

Reviewed and looks good, waiting until TODO items are addressed and @PeerRich shares his view on the "info" message, my early feedback is that it should probably read "A custom redirect will disable the built-in success page. Make sure to mention "Booking Confirmed" on your custom success page." and that it should style like an info rather than warning.

Copy link
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

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

Requesting changes as it's not ready to merge as is.

@hariombalhara hariombalhara merged commit 1758288 into main Apr 4, 2023
@hariombalhara hariombalhara deleted the fix/immediate-redirect branch April 4, 2023 08:52
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.

3 participants