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: error when unlinking google account #15011

Merged

Conversation

zomars
Copy link
Member

@zomars zomars commented May 13, 2024

What does this PR do?

fix-account-unlink.mov

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected)
  • I have added a Docs issue here if this PR makes changes that would require a documentation change
  • I have added or modified automated tests that prove my fix is effective or that my feature works (PRs might be rejected if logical changes are not properly tested)

How should this be tested?

yarn test unlinkConnectedAccount
  • Are there environment variables that should be set?
    • No
  • What are the minimal test data to have?
    • Having identityProvider and identityProviderId
  • What is expected (happy path) to have (input and output)?
    • Have an account with email and password
    • Link a google account with the same email
    • Go to profile settings and unlink it
  • Any other important info that could help to test that PR
    • Nope

Copy link

linear bot commented May 13, 2024

Copy link
Contributor

github-actions bot commented May 13, 2024

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

@github-actions github-actions bot added authentication area: authentication, auth, google sign in, password, SAML, password reset, can't log in foundation High priority Created by Linear-GitHub Sync 🐛 bug Something isn't working labels May 13, 2024
@keithwillcode keithwillcode added the core area: core, team members only label May 13, 2024
Copy link
Contributor

github-actions bot commented May 13, 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

vercel bot commented May 13, 2024

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

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 1:31pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 1:31pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 1:31pm

Copy link

deploysentinel bot commented May 13, 2024

Current Playwright Test Results Summary

✅ 321 Passing - ⚠️ 30 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 05/14/2024 01:45:24pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 209b721

Started: 05/14/2024 01:40:59pm UTC

⚠️ Flakes

📄   apps/web/playwright/integrations-stripe.e2e.ts • 4 Flakes

Top 1 Common Error Messages

null

4 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Stripe integration Paid booking should be able to be rescheduled
Retry 1Initial Attempt
2.95% (7) 7 / 237 runs
failed over last 7 days
12.66% (30) 30 / 237 runs
flaked over last 7 days
Stripe integration Paid booking should be able to be cancelled
Retry 1Initial Attempt
2.97% (7) 7 / 236 runs
failed over last 7 days
10.17% (24) 24 / 236 runs
flaked over last 7 days
Stripe integration When event is paid and confirmed Payment should confirm pending payment booking
Retry 1Initial Attempt
2.56% (6) 6 / 234 runs
failed over last 7 days
5.13% (12) 12 / 234 runs
flaked over last 7 days
Stripe integration When event is paid and confirmed Paid and confirmed booking should be able to be rescheduled
Retry 1Initial Attempt
2.15% (5) 5 / 233 runs
failed over last 7 days
4.72% (11) 11 / 233 runs
flaked over last 7 days

📄   apps/web/playwright/event-types.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Event Types tests -- legacy user can add multiple organizer address
Retry 1Initial Attempt
0.38% (1) 1 / 260 run
failed over last 7 days
5.77% (15) 15 / 260 runs
flaked over last 7 days

📄   apps/web/playwright/manage-booking-questions.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Manage Booking Questions For User EventType Do a booking with Checkbox type question and verify a few thing in b/w
Retry 1Initial Attempt
0.38% (1) 1 / 262 run
failed over last 7 days
3.82% (10) 10 / 262 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Reschedule Tests Attendee should be able to reschedule a booking
Retry 1Initial Attempt
0% (0) 0 / 291 runs
failed over last 7 days
0.69% (2) 2 / 291 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
MEETING_ENDED, MEETING_STARTED should create/remove scheduledWebhookTriggers for existing bookings
Retry 2Retry 1Initial Attempt
4.17% (3) 3 / 72 runs
failed over last 7 days
41.67% (30) 30 / 72 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Teams - NonOrg -- future Team Onboarding Invite Members
Retry 1Initial Attempt
2.26% (6) 6 / 266 runs
failed over last 7 days
21.05% (56) 56 / 266 runs
flaked over last 7 days

📄   apps/web/playwright/managedBooking/advancedOptions.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Check advanced options in a managed team event type Check advanced options in a managed team event type without offer seats
Retry 1Initial Attempt
0% (0) 0 / 260 runs
failed over last 7 days
50% (130) 130 / 260 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/namespacing.e2e.ts • 4 Flakes

Top 1 Common Error Messages

null

4 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Namespacing Inline Embed Add inline embed using a namespace without reload
Retry 1Initial Attempt
0.39% (1) 1 / 259 run
failed over last 7 days
56.76% (147) 147 / 259 runs
flaked over last 7 days
Namespacing Different namespaces can have different init configs
Retry 1Initial Attempt
0% (0) 0 / 258 runs
failed over last 7 days
57.36% (148) 148 / 258 runs
flaked over last 7 days
Namespacing Inline Embed Double install Embed Snippet with inline embed without a namespace(i.e. default namespace)
Retry 1Initial Attempt
0% (0) 0 / 259 runs
failed over last 7 days
59.46% (154) 154 / 259 runs
flaked over last 7 days
Namespacing Inline Embed Double install Embed Snippet with inline embed using a namespace
Retry 1Initial Attempt
0.77% (2) 2 / 259 runs
failed over last 7 days
57.14% (148) 148 / 259 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Update Profile Can update a users email (verification enabled)
Retry 1Initial Attempt
38.70% (113) 113 / 292 runs
failed over last 7 days
33.90% (99) 99 / 292 runs
flaked over last 7 days

📄   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 -- legacy login flow user & logout using dashboard
Retry 1Initial Attempt
0% (0) 0 / 260 runs
failed over last 7 days
18.46% (48) 48 / 260 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 9 Flakes

Top 1 Common Error Messages

null

9 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should open embed iframe on click - Configured with light theme
Retry 1Initial Attempt
1.15% (3) 3 / 261 runs
failed over last 7 days
55.56% (145) 145 / 261 runs
flaked over last 7 days
Popup Tests should be able to reschedule
Retry 1Initial Attempt
-128.32% (-145) -145 / 113 runs
failed over last 7 days
128.32% (145) 145 / 113 runs
flaked over last 7 days
Popup Tests should open Routing Forms embed on click
Retry 1Initial Attempt
-126.55% (-143) -143 / 113 runs
failed over last 7 days
126.55% (143) 143 / 113 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe according to system theme when no theme is configured through Embed API
Retry 1Initial Attempt
-123.89% (-140) -140 / 113 runs
failed over last 7 days
124.78% (141) 141 / 113 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe(Booker Profile Page) with dark theme when configured with dark theme using Embed API
Retry 1Initial Attempt
-125.89% (-141) -141 / 112 runs
failed over last 7 days
125.89% (141) 141 / 112 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe according to system theme when configured with 'auto' theme using Embed API
Retry 1Initial Attempt
-125.89% (-141) -141 / 112 runs
failed over last 7 days
125.89% (141) 141 / 112 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe(Event Booking Page) with dark theme when configured with dark theme using Embed API
Retry 1Initial Attempt
-125.89% (-141) -141 / 112 runs
failed over last 7 days
125.89% (141) 141 / 112 runs
flaked over last 7 days
Popup Tests prendered embed should be loaded and apply the config given to it
Retry 1Initial Attempt
-125.89% (-141) -141 / 112 runs
failed over last 7 days
125.89% (141) 141 / 112 runs
flaked over last 7 days
Popup Tests should open on clicking child element
Retry 1Initial Attempt
-122.52% (-136) -136 / 111 runs
failed over last 7 days
122.52% (136) 136 / 111 runs
flaked over last 7 days

📄   apps/web/playwright/organization/organization-invitation.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Organization Email not matching orgAutoAcceptEmail nonexisting user invited to a Team inside organization
Retry 1Initial Attempt
0.38% (1) 1 / 261 run
failed over last 7 days
4.98% (13) 13 / 261 runs
flaked over last 7 days
Organization Email matching orgAutoAcceptEmail and a Verified Organization with DNS Setup Done nonexisting user is invited to a team inside organization
Retry 1Initial Attempt
0% (0) 0 / 257 runs
failed over last 7 days
7% (18) 18 / 257 runs
flaked over last 7 days

📄   apps/web/playwright/team/team-invitation.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Team Invitation (non verified)
Retry 1Initial Attempt
4.07% (11) 11 / 270 runs
failed over last 7 days
6.67% (18) 18 / 270 runs
flaked over last 7 days
Team Invitation (verified)
Retry 1Initial Attempt
1.85% (5) 5 / 270 runs
failed over last 7 days
8.52% (23) 23 / 270 runs
flaked over last 7 days

📄   packages/app-store/routing-forms/playwright/tests/basic.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Routing Forms Seeded Routing Form Router URL should work
Retry 1Initial Attempt
0.38% (1) 1 / 260 run
failed over last 7 days
16.54% (43) 43 / 260 runs
flaked over last 7 days

View Detailed Build Results


Copy link
Member Author

@zomars zomars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self review done

@@ -439,10 +448,7 @@ const ProfileView = () => {
<Button
color="primary"
onClick={() => {
updateProfileMutation.mutate({
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't make much sense to have this being part of updateProfile. updateProfile is doing too much already.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added simple unit/integration test

@@ -74,9 +73,6 @@ export const updateProfileHandler = async ({ ctx, input }: UpdateProfileOptions)
const secondaryEmails = input?.secondaryEmails || [];
delete input.secondaryEmails;

const unlinkConnectedAccount = input?.unlinkConnectedAccount || false;
delete input.unlinkConnectedAccount;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH. This feels like a hack. Separated to new handler.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single purpose handler in here

@zomars zomars marked this pull request as ready for review May 13, 2024 21:07
@dosubot dosubot bot added this to the v4.2 milestone May 13, 2024
@zomars zomars modified the milestones: v4.2, v4.1 May 13, 2024
@zomars zomars self-assigned this May 13, 2024
@zomars zomars requested a review from a team May 13, 2024 21:07
Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested and worked fine

@Udit-takkar Udit-takkar enabled auto-merge (squash) May 14, 2024 09:51
@Udit-takkar Udit-takkar disabled auto-merge May 14, 2024 09:51
@zomars zomars merged commit e030fe0 into main May 14, 2024
40 checks passed
@zomars zomars deleted the zomars/cal-3519-error-when-trying-to-unlink-a-google-account branch May 14, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authentication area: authentication, auth, google sign in, password, SAML, password reset, can't log in 🐛 bug Something isn't working 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.

[CAL-3519] Error when trying to unlink a google account
4 participants