cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

feat: Refactor to Use credentialRepository for credential create.

Open vijayraghav-io opened this issue 1 year ago • 9 comments

What does this PR do?

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

Refer PR: https://github.com/calcom/cal.com/pull/16878

To Do : Remove explicit callings of BookingReferenceRepository.reconnectWithNewCredential() everywhere, introduced from the PR https://github.com/calcom/cal.com/pull/16878, if that Issue fix PR is merged before.

Mandatory Tasks (DO NOT REMOVE)

  • [x] 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.
  • [x] I confirm automated tests are in place that prove my fix is effective or that my feature works.

vijayraghav-io avatar Oct 25 '24 18:10 vijayraghav-io

@vijayraghav-io is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 25 '24 18:10 vercel[bot]

Graphite Automations

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

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

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

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

"Add community label" took an action on this PR • (10/25/24)

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

"Add ready-for-e2e label" took an action on this PR • (10/28/24)

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

graphite-app[bot] avatar Oct 25 '24 18:10 graphite-app[bot]

I did notice, In the second test case you are using the newGoogleCalCredentialId, This might be involuntary as google_meet_video should ideally connect to the newGoogleMeetCredentialId instead of newGoogleCalCredentialId.

Good notice!. This is intentional, google_video being a special case and that's why this test case was added. Please refer this https://github.com/calcom/cal.com/blob/7d51741de0f3b5fc286ca9c1aac1da47ea66a689/packages/features/bookings/lib/handleNewBooking.ts#L1130

here the credential of googleCal is mapped to google_meet_video as well, while creating the bookingReferences for new booking. As per the generic app installation flow, credential record for google_video will be created, but the keys will be empty, google_calendar 's credential is only used for google video as well.

vijayraghav-io avatar Oct 27 '24 06:10 vijayraghav-io

I did notice, In the second test case you are using the newGoogleCalCredentialId, This might be involuntary as google_meet_video should ideally connect to the newGoogleMeetCredentialId instead of newGoogleCalCredentialId.

Good notice!. This is intentional, google_video being a special case and that's why this test case was added. Please refer this

https://github.com/calcom/cal.com/blob/7d51741de0f3b5fc286ca9c1aac1da47ea66a689/packages/features/bookings/lib/handleNewBooking.ts#L1130

here the credential of googleCal is mapped to google_meet_video as well, while creating the bookingReferences for new booking. As per the generic app installation flow, credential record for google_video will be created, but the keys will be empty, google_calendar 's credential is only used for google video as well.

ahh got it, I need a final check, I'll let you know..

Praashh avatar Oct 27 '24 08:10 Praashh

E2E results are ready!

github-actions[bot] avatar Oct 28 '24 11:10 github-actions[bot]

This may have been taken care of by @hbjORbj in #17443

keithwillcode avatar Nov 07 '24 13:11 keithwillcode

No, this https://github.com/calcom/cal.com/pull/17443 is not reconnecting booking references, which is the purpose of this current PR

vijayraghav-io avatar Nov 07 '24 13:11 vijayraghav-io

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Dec 03 '24 00:12 github-actions[bot]

This PR is being marked as stale due to inactivity.

github-actions[bot] avatar Dec 31 '24 00:12 github-actions[bot]

Hey @vijayraghav-io this pr has been drafted and inactive since a very long time and also facing merge conflicts. Closing it for now. Feel free for a reopen.

Devanshusharma2005 avatar Jun 28 '25 07:06 Devanshusharma2005