Skip to content
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

Merged
merged 6 commits into from
Feb 22, 2024

Conversation

emrysal
Copy link
Contributor

@emrysal emrysal commented Feb 16, 2024

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.

Copy link
Contributor

github-actions bot commented Feb 16, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@keithwillcode keithwillcode added core area: core, team members only foundation labels Feb 16, 2024
Copy link

vercel bot commented Feb 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 11:32am
cal ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 11:32am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 11:32am
qa ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 11:32am

Copy link

graphite-app bot commented Feb 16, 2024

Graphite Automations

A 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'

Copy link
Contributor

github-actions bot commented Feb 16, 2024

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link

deploysentinel bot commented Feb 16, 2024

Current Playwright Test Results Summary

✅ 81 Passing - ⚠️ 2 Flaky

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 Details

Running Workflow PR Update on Github Actions

Commit: 4da10c9

Started: 02/22/2024 12:01:48pm UTC

⚠️ Flakes

📄   apps/web/playwright/login.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
user can login & logout succesfully -- future login flow user & logout using dashboard
Retry 1Initial Attempt
0.45% (1) 1 / 221 run
failed over last 7 days
43.44% (96) 96 / 221 runs
flaked 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 1Initial Attempt
0% (0) 0 / 229 runs
failed over last 7 days
11.79% (27) 27 / 229 runs
flaked over last 7 days

View Detailed Build Results


Comment on lines 128 to 131
// 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
Copy link
Contributor

@Udit-takkar Udit-takkar Feb 20, 2024

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

should it be ?


 res.redirect(
    getSafeRedirectUrl(state?.returnTo) ??
      getInstalledAppPath({ variant: "calendar", slug: "google-calendar" })
  );

Copy link
Contributor Author

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!

Udit-takkar
Udit-takkar previously approved these changes Feb 22, 2024
@Udit-takkar Udit-takkar enabled auto-merge (squash) February 22, 2024 11:33
@Udit-takkar Udit-takkar merged commit 3d1ac45 into main Feb 22, 2024
39 checks passed
@Udit-takkar Udit-takkar deleted the fix/orphaned-selected-calendars branch February 22, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only foundation High priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants