[CLEAN] Synthetic Benchmark PR #25963 - chore: Ensure that uuid is available in server session[Booking Audit Prerequisite]#383
Open
tomerqodo wants to merge 1 commit intobase_pr_25963_20260114_1810from
Conversation
|
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: |
|
This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active. |
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.
Benchmark PR calcom#25963
Type: Clean (correct implementation)
Original PR Title: chore: Ensure that uuid is available in server session[Booking Audit Prerequisite]
Original PR Description: ## What does this PR do?
Similar to calcom#25721, adds uuid in session so that BookingAudit has it readily available
Adds the user's UUID to the booking metadata by:
Userinterface to include an optionaluuidproperty from PrismaUseruuidrequired onSession.uservia intersection type (User & { uuid: PrismaUser["uuid"] })uuidto the session user object ingetServerSession.tsuuidto theAdapterUsertransformation innext-auth-custom-adapter.tsuserUuidfrom the session to the booking creation flowuuidin the user data (repository, service, and type definitions)req.userUuidas a required field on the request object (likereq.userId)uuidto mock session objects in web app routes and test contextuuidto thefindByEmailAndIncludeProfilesAndPasswordquery in UserRepositoryAlso removes commented-out code that was placeholder for future work and fixes lint warnings for unused variables.
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
uuidfield on the user objectuserUuidis included in the booking metadata/api/invitesPOST and/api/teams/[teamId]/publish) to verify they receive the uuid from the authenticated userHuman Review Checklist
uuid- if not, this change will passundefinedat runtimeuserUuidis consumed downstream in the booking servicePrismaApiKeyRepository.findByHashedKey()correctly fetches the user's uuid from the databaseApiKeyService.tsensuresresult.useris always defined whenresult.validis truereq.userUuidgo through theverifyApiKeymiddlewareUserRepository.findByEmailAndIncludeProfilesAndPassword()includesuuidin the select clauseUpdates since last revision
uuidis optional on the NextAuthUserinterface but required onSession.uservia intersection type. This allows SAML providers to not supply uuid at the profile stage while ensuring uuid is always present on the session after the user is resolved from the database.Link to Devin run: https://app.devin.ai/sessions/97e5603b719a420b9b35041252c9db26
Requested by: hariom@cal.com (@hariombalhara)
Original PR URL: calcom#25963