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

add try catch block in packages/email/templates/_base-email.ts getRec…

Open tony83033 opened this issue 2 years ago • 3 comments

What does this PR do?

Lack of error handling in the /packages/email/templates/_base-email.ts -> getRecipientTime method: The dayjs library can throw errors if it is passed an invalid date string, but these errors are not being handled in the getRecipientTime method.

Type of change

  • Chore (refactoring code, technical debt, workflow improvements)

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

  • I haven't checked if new and existing unit tests pass locally with my changes

tony83033 avatar May 05 '23 21:05 tony83033

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

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2023 9:10pm

vercel[bot] avatar May 05 '23 21:05 vercel[bot]

@tony83033 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 May 05 '23 21:05 vercel[bot]

📦 Next.js Bundle Analysis for @calcom/web

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

Sixty-five 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] 152.02 KB 302.45 KB 86.41% (🟡 +4.72%)
/[user]/[type] 199.98 KB 350.41 KB 100.12% (🟡 +4.68%)
/[user]/[type]/embed 200.01 KB 350.44 KB 100.13% (🟡 +4.68%)
/[user]/book 270.42 KB 420.85 KB 120.24% (🟡 +4.70%)
/[user]/embed 152.09 KB 302.52 KB 86.43% (🟡 +4.72%)
/apps 275.1 KB 425.53 KB 121.58% (🟢 -0.26%)
/apps/[slug] 293.04 KB 443.47 KB 126.70% (🟢 -0.25%)
/apps/[slug]/[...pages] 472.67 KB 623.1 KB 178.03% (🟡 +4.56%)
/apps/categories 254.91 KB 405.34 KB 115.81% (🟡 +4.70%)
/apps/categories/[category] 258.3 KB 408.73 KB 116.78% (🟢 -0.26%)
/apps/installed/[category] 274.99 KB 425.42 KB 121.55% (🟢 -0.25%)
/auth/setup 191.31 KB 341.74 KB 97.64% (🟡 +4.76%)
/availability 260.23 KB 410.66 KB 117.33% (🟡 +4.70%)
/availability/[schedule] 347.17 KB 497.6 KB 142.17% (🟡 +4.68%)
/availability/troubleshoot 255.6 KB 406.03 KB 116.01% (🟡 +4.70%)
/booking/[uid] 232.12 KB 382.55 KB 109.30% (🟡 +4.71%)
/bookings/[status] 355.56 KB 505.99 KB 144.57% (🟡 +4.69%)
/d/[link]/[slug] 199.63 KB 350.06 KB 100.02% (🟡 +4.68%)
/d/[link]/[slug]/embed 199.66 KB 350.09 KB 100.02% (🟡 +4.69%)
/d/[link]/book 270.07 KB 420.5 KB 120.14% (🟡 +4.70%)
/event-types 430.92 KB 581.35 KB 166.10% (🟡 +4.15%)
/event-types/[type] 466.91 KB 617.34 KB 176.38% (🟡 +4.51%)
/getting-started/[[...step]] 413.21 KB 563.64 KB 161.04% (🟢 -0.40%)
/insights 463.75 KB 614.18 KB 175.48% (🟡 +4.70%)
/more 254.54 KB 404.97 KB 115.70% (🟡 +4.70%)
/new-booker/[user]/[type] 301.81 KB 452.24 KB 129.21% (🟡 +5.27%)
/new-booker/team/[slug]/[type] 301.81 KB 452.24 KB 129.21% (🟡 +5.27%)
/payment/[uid] 126.1 KB 276.53 KB 79.01% (🟡 +4.71%)
/settings/admin 260.14 KB 410.57 KB 117.31% (🟡 +4.70%)
/settings/admin/apps 271.66 KB 422.09 KB 120.60% (🟡 +4.70%)
/settings/admin/apps/[category] 271.65 KB 422.08 KB 120.59% (🟡 +4.70%)
/settings/admin/flags 262.79 KB 413.22 KB 118.06% (🟡 +4.71%)
/settings/admin/impersonation 260.43 KB 410.86 KB 117.39% (🟡 +4.71%)
/settings/admin/users 261.55 KB 411.98 KB 117.71% (🟡 +4.70%)
/settings/admin/users/[id]/edit 348.34 KB 498.77 KB 142.50% (🟡 +4.62%)
/settings/admin/users/add 348.06 KB 498.49 KB 142.42% (🟡 +4.63%)
/settings/billing 260.27 KB 410.7 KB 117.34% (🟡 +4.71%)
/settings/developer/api-keys 288.84 KB 439.27 KB 125.51% (🟡 +4.70%)
/settings/developer/webhooks 262.65 KB 413.08 KB 118.02% (🟡 +4.71%)
/settings/developer/webhooks/[id] 266.04 KB 416.47 KB 118.99% (🟡 +4.71%)
/settings/developer/webhooks/new 265.9 KB 416.33 KB 118.95% (🟡 +4.71%)
/settings/my-account/appearance 274.38 KB 424.81 KB 121.37% (🟡 +4.64%)
/settings/my-account/calendars 266.88 KB 417.31 KB 119.23% (🟡 +4.70%)
/settings/my-account/conferencing 265.74 KB 416.17 KB 118.91% (🟡 +4.70%)
/settings/my-account/general 342.15 KB 492.58 KB 140.74% (🟡 +4.70%)
/settings/my-account/profile 376.97 KB 527.4 KB 150.69% (🟡 +4.24%)
/settings/security/impersonation 262.04 KB 412.47 KB 117.85% (🟡 +4.70%)
/settings/security/password 272.65 KB 423.08 KB 120.88% (🟡 +4.69%)
/settings/security/sso 269.64 KB 420.07 KB 120.02% (🟡 +4.70%)
/settings/security/two-factor-auth 264.47 KB 414.9 KB 118.54% (🟡 +4.71%)
/settings/teams 259.9 KB 410.33 KB 117.24% (🟡 +4.70%)
/settings/teams/[id]/appearance 274.2 KB 424.63 KB 121.32% (🟡 +4.64%)
/settings/teams/[id]/billing 260.13 KB 410.56 KB 117.30% (🟡 +4.71%)
/settings/teams/[id]/members 373.58 KB 524 KB 149.72% (🟡 +4.64%)
/settings/teams/[id]/profile 372.34 KB 522.77 KB 149.36% (🟡 +4.24%)
/settings/teams/[id]/sso 269.73 KB 420.16 KB 120.05% (🟡 +4.70%)
/settings/teams/new 199.4 KB 349.83 KB 99.95% (🟡 +4.79%)
/team/[slug] 172.12 KB 322.55 KB 92.16% (🟡 +4.77%)
/team/[slug]/[type] 199.63 KB 350.06 KB 100.02% (🟡 +4.68%)
/team/[slug]/[type]/embed 199.66 KB 350.09 KB 100.03% (🟡 +4.68%)
/team/[slug]/book 270.07 KB 420.5 KB 120.14% (🟡 +4.70%)
/team/[slug]/embed 172.19 KB 322.62 KB 92.18% (🟡 +4.77%)
/teams 254.63 KB 405.06 KB 115.73% (🟡 +4.70%)
/workflows 267.44 KB 417.87 KB 119.39% (🟡 +4.70%)
/workflows/[workflow] 373.31 KB 523.74 KB 149.64% (🟡 +4.38%)
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 May 05 '23 21:05 github-actions[bot]

Ideally we'd let this error bubble up to the main error handler and handle there; not handling in the function itself; hope that makes sense 🙏

emrysal avatar May 10 '23 08:05 emrysal