-
Notifications
You must be signed in to change notification settings - Fork 10k
perf: fetch server side data for workflow details page #20778
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
base: main
Are you sure you want to change the base?
perf: fetch server side data for workflow details page #20778
Conversation
@TusharBhatt1 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mrge found 3 issues across 5 files. View them in mrge.io
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (04/20/25)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (04/20/25)1 label was added to this PR based on Keith Williams's automation. |
teamId: workflow?.team?.id, | ||
}, | ||
{ enabled: !verifiedEmailsProp } | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to server side
…https://github.com/TusharBhatt1/cal.com into perf/fetch-server-side-data-for-dynamic-webflow-page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job Tushar! That was fast. But this requires some changes.
E2E results are ready! |
Thanks @hbjORbj , I have addresed them all - can you have a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mrge found 3 issues across 7 files. View them in mrge.io
// teamId: workflow?.team?.id, | ||
// }); | ||
// } catch (err) {} | ||
const [verifiedEmails, verifiedNumbers, eventsData, user, actionOptions] = await Promise.all([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using index-based destructuring from Promise.all results can be error-prone if the order of promises changes in the future.
// teamId: workflow?.team?.id, | ||
// }); | ||
// } catch (err) {} | ||
const [verifiedEmails, verifiedNumbers, eventsData, user, actionOptions] = await Promise.all([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing error handling for Promise.all. If any of these async calls fail, the entire page will fail.
@TusharBhatt1 Please review my comments more carefully and only ping me after more careful review of your code yourself. As I mentioned before, let's minimize the number of ping pongs as much as possible. Don't wanna spend 7-8 ping-pongs on a small change like the last time. |
…https://github.com/TusharBhatt1/cal.com into perf/fetch-server-side-data-for-dynamic-webflow-page
This PR is being marked as stale due to inactivity. |
Closing due to inactivity. Feel free to tag me if you wanted to continue 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can follow the new pattern here as well 🙏
const [workflowCaller, eventCaller, userCaller] = await Promise.all([ | ||
createRouterCaller(workflowsRouter), | ||
createRouterCaller(eventTypesRouter), | ||
createRouterCaller(meRouter), | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can directly use Repository methods inside unstable_cache here wherever possible
https://github.com/calcom/cal.com/pull/20773/files#r2173620412
const [verifiedEmails, verifiedNumbers, eventsData, user] = await Promise.all([ | ||
workflowCaller.getVerifiedEmails({ teamId }), | ||
teamId ? workflowCaller.getVerifiedNumbers({ teamId }) : Promise.resolve([]), | ||
eventCaller.getTeamAndEventTypeOptions({ teamId, isOrg }), | ||
userCaller.get(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…https://github.com/TusharBhatt1/cal.com into perf/fetch-server-side-data-for-dynamic-webflow-page
What does this PR do?
This PR moves all the
/workflows/[id]
data fetching to server side.Visual Demo (For contributors especially)
Before :


After:
dynamic-worklflows.mp4
Mandatory Tasks (DO NOT REMOVE)
Summary by mrge
Moved all data fetching for the
/workflows/[id]
page to the server side to improve performance and reliability.