-
Notifications
You must be signed in to change notification settings - Fork 7k
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
fix: multiple getSchedule requests on email change in booker #15616
base: main
Are you sure you want to change the base?
Conversation
@dilpreetsio is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Graphite Automations"Add community label" took an action on this PR • (06/28/24)1 label was added to this PR based on Keith Williams's automation. "Add consumer team as reviewer" took an action on this PR • (06/28/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add platform team as reviewer" took an action on this PR • (06/28/24)1 reviewer was added to this PR based on Keith Williams's automation. |
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.
Hey, one more request is being sent - checkIfUserEmailVerificationRequired
. This is from the useVerifyEmail hook. Do you think it would be optimal to not pass bookerEmail? This bookerEmail retrieves the email address of the owner of a contact in the CRM system.
@anikdhabal The |
making a server request on every keystroke can be costly |
The input is debounced to reduce the number of request. If we want to further reduce the number of requests one way to go ahead would be check if the email is valid before sending a request. |
Do you mean not passing the bookerEmail to the |
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.
@dilpreetsio how does this fix the issue?
bookerEmail was required in packages/trpc/server/routers/viewer/slots/util.ts
const crmContactOwner = await getCRMContactOwnerForRRLeadSkip(
input.bookerEmail,
eventType?.metadata?.apps
);
Yes, @Udit-takkar shared the code above. |
What does this PR do?
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
There are no more requests for slots when the email is changed.
Screen.Recording.2024-06-28.at.7.52.55.PM.mov