-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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: Update credentialId when null for a given selectedCalendar #13735
Conversation
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 4 Ignored Deployments
|
Graphite AutomationsA Graphite automation took an action on this PR • (02/16/24)1 reviewer was added based on Keith Williams's automation, 'Add foundation team as reviewer' |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Current Playwright Test Results Summary✅ 81 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 02/22/2024 12:04:58pm UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: 4da10c9 Started: 02/22/2024 12:01:48pm UTC
|
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
user can login & logout succesfully -- future login flow user & logout using dashboard
Retry 1 • Initial Attempt |
0.45% (1)1 / 221 runfailed over last 7 days |
43.44% (96)96 / 221 runsflaked over last 7 days |
📄 apps/web/playwright/impersonation.e2e.ts • 1 Flake
Test Case Results
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Users can impersonate App Admin can impersonate users with impersonation enabled
Retry 1 • Initial Attempt |
0% (0)0 / 229 runsfailed over last 7 days |
11.79% (27)27 / 229 runsflaked over last 7 days |
// it is possible a selectedCalendar was orphaned, in this situation- | ||
// we want to recover by connecting the existing selectedCalendar to the new Credential. | ||
if (await renewSelectedCalendarCredentialId(selectedCalendarWhereUnique, credential.id)) return; | ||
// else |
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.
I tried removing replicating this by editing credentialId to null in 'Selected Calendar' Table.
Now when i tried connecting the same calendar again I am stuck on this screen
probably because of this return statement.
![Screenshot 2024-02-20 at 2 53 35 PM](https://private-user-images.githubusercontent.com/53316345/306205871-fca82a8d-4892-46ad-97a3-018bbeaf644b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE1OTExOTAsIm5iZiI6MTcyMTU5MDg5MCwicGF0aCI6Ii81MzMxNjM0NS8zMDYyMDU4NzEtZmNhODJhOGQtNDg5Mi00NmFkLTk3YTMtMDE4YmJlYWY2NDRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIxVDE5NDEzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZhOTdmMzUzMTM4ZDczMTkyNmExODYzMTg1YWU3NjQzZWRhNDQxYzk2MmUyZTk4MDNmNzYyYWFjZmU0NWQwMWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ey7QZu50f0MJLh0BA1eEDpbvraTSf_YKwJApRfS6_UE)
should it be ?
res.redirect(
getSafeRedirectUrl(state?.returnTo) ??
getInstalledAppPath({ variant: "calendar", slug: "google-calendar" })
);
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.
Oh yeah because it doesn't return there's no return path!
What does this PR do?
When a credential is created - when a selectedCalendar exists with credentialId null; instead of failing as before; we find the orphaned selectedCalendar and connect it to the new credential.