perf: Paraellelize calls in team event type SSR#27486
Merged
joeauyeung merged 4 commits intomainfrom Feb 3, 2026
Merged
Conversation
Contributor
E2E results are ready! |
alishaz-polymath
previously approved these changes
Feb 2, 2026
Member
|
LGTM, but Tests Failing. Seem unrelated but worth a confirmation |
e6212f2
hariombalhara
approved these changes
Feb 3, 2026
Comment on lines
+109
to
+134
| getUsersData(team.isPrivate, eventTypeId, eventData.hosts.map((h) => h.user)).catch((err) => { | ||
| log.error("Failed to get users data", err); | ||
| throw err; | ||
| }), | ||
| needsCrmLookup | ||
| ? import("@calcom/features/ee/teams/lib/getTeamMemberEmailFromCrm") | ||
| .then(({ getTeamMemberEmailForResponseOrContactUsingUrlQuery }) => | ||
| getTeamMemberEmailForResponseOrContactUsingUrlQuery({ query, eventData }) | ||
| ) | ||
| .catch((err) => { | ||
| log.error("Failed CRM lookup", err); | ||
| throw err; | ||
| }) | ||
| : Promise.resolve(null), | ||
| featureRepo.checkIfTeamHasFeature(team.id, "use-api-v2-for-team-slots").catch((err) => { | ||
| log.error("Failed to check API V2 feature flag", err); | ||
| throw err; | ||
| }), | ||
| rescheduleUid | ||
| ? getServerSession({ req }) | ||
| .then((session) => getBookingForReschedule(`${rescheduleUid}`, session?.user?.id)) | ||
| .catch((err) => { | ||
| log.error("Failed to get booking for reschedule", err); | ||
| throw err; | ||
| }) | ||
| : Promise.resolve(null), |
Member
There was a problem hiding this comment.
nit: if we could refactor it to
Promise.all([a(),b(),c()..]) then it would be much easier to read.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
getUsersData, CRM lookup, feature flag check, and getting rescheduled booking in aPromise.allMandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist
Summary by cubic
Parallelized independent server calls in team event type SSR to reduce page load time. Simplified CRM param handling and added scoped logging and error handling.
Performance
Refactors
Written for commit 8480783. Summary will update on new commits.