Skip to content

perf: duplicate getSchedule request#17191

Merged
keithwillcode merged 3 commits intomainfrom
fix/duplicate-getSchedule
Oct 20, 2024
Merged

perf: duplicate getSchedule request#17191
keithwillcode merged 3 commits intomainfrom
fix/duplicate-getSchedule

Conversation

@Udit-takkar
Copy link
Contributor

@Udit-takkar Udit-takkar commented Oct 19, 2024

What does this PR do?

  • Fixes #XXXX (GitHub issue number)
  • Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Before:-

Screenshot 2024-10-19 at 11 21 45 PM

After:-

Screenshot 2024-10-19 at 11 23 53 PM

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Create a team event type and go to the booking page

@Udit-takkar Udit-takkar added the High priority Created by Linear-GitHub Sync label Oct 19, 2024
@Udit-takkar Udit-takkar added this to the v4.7 milestone Oct 19, 2024
@dosubot dosubot bot added the performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive label Oct 19, 2024
@keithwillcode keithwillcode added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Oct 19, 2024
@graphite-app graphite-app bot requested a review from a team October 19, 2024 17:51
@Udit-takkar Udit-takkar added the 🚨 urgent Created by Linear-GitHub Sync label Oct 19, 2024
@Udit-takkar Udit-takkar marked this pull request as draft October 19, 2024 17:54
@graphite-app
Copy link

graphite-app bot commented Oct 19, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (10/19/24)

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2024

E2E results are ready!

@vercel
Copy link

vercel bot commented Oct 20, 2024

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Oct 20, 2024 7:21am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Oct 20, 2024 7:21am

isTeamEvent?: boolean;
} = {}) => {
const { timezone } = useTimePreferences();
const event = useEvent({ fromRedirectOfNonOrgLink });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we are already using useEvent hook in the parent component.

rescheduleUid,
month: monthFromStore ?? month,
duration: durationFromStore ?? duration,
isTeamEvent: pathname?.indexOf("/team/") !== -1 || isTeam,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was causing duplicate request of getSchedule. isTeam was intially false but later it was calculated to be true for team event types

return {
props: {
entity: eventData.entity,
eventTypeId: eventData.id,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just pass the eventTypeId from getServersideProps to prevent waiting for it to load in public.event query and execute slots.getSchedule as soon as we can with the correct input

@Udit-takkar Udit-takkar marked this pull request as ready for review October 20, 2024 07:28
@dosubot dosubot bot added the bookings area: bookings, availability, timezones, double booking label Oct 20, 2024
@keithwillcode keithwillcode merged commit c7f4f52 into main Oct 20, 2024
@keithwillcode keithwillcode deleted the fix/duplicate-getSchedule branch October 20, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bookings area: bookings, availability, timezones, double booking core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO High priority Created by Linear-GitHub Sync performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive ready-for-e2e 🚨 urgent Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants