Skip to content

perf: GCal reduce calendar payload#10853

Merged
keithwillcode merged 4 commits into
mainfrom
perf/reduce-gcal-payload
Aug 21, 2023
Merged

perf: GCal reduce calendar payload#10853
keithwillcode merged 4 commits into
mainfrom
perf/reduce-gcal-payload

Conversation

@joeauyeung
Copy link
Copy Markdown
Contributor

@joeauyeung joeauyeung commented Aug 19, 2023

What does this PR do?

Explored reducing the payload size from GCal queries.

Reducing the freebusy query had no difference in payload size.

Reducing the calendar query payload of 4 calendars, the size went from 1895 to 434 bytes.

Fixes # (issue)

Requirement/Documentation

  • If there is a requirement document, please, share it here.
  • If there is ab UI/UX design document, please, share it here.

Type of change

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

How should this be tested?

  • Connect a GCal account
  • The list of calendars should be listed on the calendar page
  • On the booking page, any events on the GCal should be blocked

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • 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

@joeauyeung joeauyeung marked this pull request as draft August 19, 2023 23:37
@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 19, 2023

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

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2023 11:56pm
cal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2023 11:56pm
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2023 11:56pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Aug 19, 2023 11:56pm
qa ⬜️ Ignored (Inspect) Visit Preview Aug 19, 2023 11:56pm
ui ⬜️ Ignored (Inspect) Visit Preview Aug 19, 2023 11:56pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 19, 2023

Thank you for following the naming conventions! 🙏

@zomars zomars added the core area: core, team members only label Aug 19, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 19, 2023

📦 Next.js Bundle Analysis for @calcom/web

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

This PR introduced no changes to the JavaScript bundle! 🙌

@deploysentinel
Copy link
Copy Markdown

deploysentinel Bot commented Aug 19, 2023

Current Playwright Test Results Summary

✅ 116 Passing - ⚠️ 2 Flaky

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

(Last updated on 08/19/2023 11:58:03pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 410cd8a

Started: 08/19/2023 11:56:58pm UTC

⚠️ Flakes

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should be able to reschedule
Retry 1Initial Attempt
2.61% (7) 7 / 268 runs
failed over last 7 days
97.39% (261) 261 / 268 runs
flaked over last 7 days

📄   packages/app-store/typeform/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 should validate fields
Retry 1Initial Attempt
0.37% (1) 1 / 271 run
failed over last 7 days
4.06% (11) 11 / 271 runs
flaked over last 7 days

View Detailed Build Results


@joeauyeung joeauyeung marked this pull request as ready for review August 20, 2023 00:52
@joeauyeung joeauyeung requested a review from a team August 20, 2023 00:52
@joeauyeung joeauyeung self-assigned this Aug 20, 2023
@joeauyeung joeauyeung added the performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive label Aug 20, 2023
Copy link
Copy Markdown
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.

Nice optimization @joeauyeung !!

As a followup, I was thinking how we can prevent having a scenario where we are accessing a field that we didn't fetch. I don't think google calendar types prevent that from happening.

Maybe adding a zod schema would help . It doesn't seem necessary right now as the fields are accessed almost below the place where they are fetched. But it can be problematic if they are accessed somewhere else e.g. in a separate function.

@keithwillcode keithwillcode merged commit 1557755 into main Aug 21, 2023
@keithwillcode keithwillcode deleted the perf/reduce-gcal-payload branch August 21, 2023 09:27
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 performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants