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: email-address with apostrophe not accepted #15535

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

RajdeepDs
Copy link
Contributor

@RajdeepDs RajdeepDs commented Jun 22, 2024

What does this PR do?

Mandatory Tasks (DO NOT REMOVE)

  • 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
  • I have added or modified automated tests that prove my fix is effective or that my feature works (PRs might be rejected if logical changes are not properly tested)

@graphite-app graphite-app bot requested a review from a team June 22, 2024 06:50
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Jun 22, 2024
Copy link

vercel bot commented Jun 22, 2024

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

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Jun 22, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added booking-page area: booking page, public booking page, booker Medium priority Created by Linear-GitHub Sync 🐛 bug Something isn't working labels Jun 22, 2024
@dosubot dosubot bot added authentication area: authentication, auth, google sign in, password, SAML, password reset, can't log in emails area: emails, cancellation email, reschedule email, inbox, spam folder, not getting email labels Jun 22, 2024
Copy link

graphite-app bot commented Jun 22, 2024

Graphite Automations

"Add community label" took an action on this PR • (06/22/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/22/24)

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

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

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

Copy link
Contributor

github-actions bot commented Jun 24, 2024

📦 Next.js Bundle Analysis for @calcom/web

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

Twenty-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)
/[user]/[type] 416.78 KB 644.51 KB 184.14% (🟡 +0.19%)
/[user]/[type]/embed 416.79 KB 644.51 KB 184.15% (🟡 +0.18%)
/apps/[slug]/[...pages] 593.48 KB 821.2 KB 234.63% (🟡 +0.24%)
/auth/saml-idp 12.22 KB 239.95 KB 68.56% (🟢 -20.80%)
/d/[link]/[slug] 416.59 KB 644.31 KB 184.09% (🟡 +0.18%)
/event-types 566.5 KB 794.23 KB 226.92% (🟡 +0.33%)
/event-types/[type] 442.16 KB 669.88 KB 191.39% (🟡 +0.19%)
/org/[orgSlug]/[user]/[type] 416.99 KB 644.71 KB 184.20% (🟡 +0.18%)
/org/[orgSlug]/[user]/[type]/embed 417.01 KB 644.73 KB 184.21% (🟡 +0.18%)
/org/[orgSlug]/instant-meeting/team/[slug]/[type] 416.6 KB 644.33 KB 184.09% (🟡 +0.18%)
/org/[orgSlug]/team/[slug]/[type] 416.8 KB 644.52 KB 184.15% (🟡 +0.18%)
/settings/admin/lockedSMS/UsersTable 79.97 KB 307.69 KB 87.91% (🟢 -0.14%)
/settings/admin/lockedSMS/lockedSMSView 119.45 KB 347.17 KB 99.19% (🟢 -0.17%)
/settings/admin/oAuth/oAuthView 95.48 KB 323.21 KB 92.34% (🟢 -0.18%)
/settings/organizations/[id]/about 159.66 KB 387.38 KB 110.68% (🟡 +0.47%)
/settings/organizations/[id]/add-teams 159.65 KB 387.37 KB 110.68% (🟡 +0.47%)
/settings/organizations/members 406.67 KB 634.39 KB 181.25% (🟡 +0.15%)
/settings/organizations/new 159.66 KB 387.38 KB 110.68% (🟡 +0.47%)
/settings/platform/new 120.7 KB 348.43 KB 99.55% (🟡 +0.52%)
/team/[slug]/[type] 416.77 KB 644.49 KB 184.14% (🟡 +0.18%)
/team/[slug]/[type]/embed 416.8 KB 644.52 KB 184.15% (🟡 +0.18%)
/video/[uid] 291.21 KB 518.93 KB 148.27% (🟢 -0.17%)
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.

@RajdeepDs
Copy link
Contributor Author

Hi @keithwillcode,
I'm noticing that the tests for this pull request are failing. I'm not entirely familiar with the specific tests required. Could you provide some guidance on how to address these failures?

@hariombalhara
Copy link
Member

This one seems to be fixed in later zod versions. I think upgrading zod should fix it everywhere? It seems we haven't updated in a while. So, it is due anyway.

colinhacks/zod#2889

Copy link
Member

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

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

@RajdeepDs Thanks for the PR 🙏

Zod latest version should have this fixed already.

But I am also thinking that it might make sense to have this flexibility of having email validation changed by changing the RegExp. It can allow us to fix email validation everywhere without heavily relying on zod's updates.

cc @keithwillcode @zomars what do you guys think ?

@@ -14,7 +15,7 @@ export const schemaAttendeeBaseBodyParams = Attendee.pick({
const schemaAttendeeCreateParams = z
.object({
bookingId: z.number().int(),
email: z.string().email(),
email: z.string().regex(emailRegex),
Copy link
Member

@hariombalhara hariombalhara Jun 25, 2024

Choose a reason for hiding this comment

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

We should be more declarative here like defining an emailSchema somewhere and importing that directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I've made changes to the code by creating a new file emailSchema.ts that defines the emailSchema using the Reg Exp. This schema is now imported and used in the places where email validation is needed.

@graphite-app graphite-app bot requested a review from a team June 25, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authentication area: authentication, auth, google sign in, password, SAML, password reset, can't log in booking-page area: booking page, public booking page, booker 🐛 bug Something isn't working community Created by Linear-GitHub Sync emails area: emails, cancellation email, reschedule email, inbox, spam folder, not getting email Medium priority Created by Linear-GitHub Sync ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Email address with ' (apostrophe) not accepted
4 participants