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

fix: Organization Migration - Prevent the redirected username from being claimed by others.

Open hariombalhara opened this issue 1 year ago • 7 comments

What does this PR do?

Fixes #13589

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

image

Repeat the tests with calcomHandler(By setting IS_PREMIUM_USERNAME_ENABLED=1 in constants.ts)

Mandatory Tasks

  • [x] Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

hariombalhara avatar Feb 14 '24 08:02 hariombalhara

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

github-actions[bot] avatar Feb 14 '24 08:02 github-actions[bot]

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 Mar 5, 2024 3:39pm
cal ⬜️ Ignored (Inspect) Visit Preview Mar 5, 2024 3:39pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Mar 5, 2024 3:39pm
qa ⬜️ Ignored (Inspect) Visit Preview Mar 5, 2024 3:39pm

vercel[bot] avatar Feb 14 '24 08:02 vercel[bot]

📦 Next.js Bundle Analysis for @calcom/web

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

Sixty-four Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/apps 280.56 KB 468.85 KB 133.96% (🟢 -0.15%)
/apps/[slug] 298.62 KB 486.91 KB 139.12% (🟢 -0.15%)
/apps/categories 258.45 KB 446.74 KB 127.64% (🟢 -0.15%)
/apps/categories/[category] 262.7 KB 450.99 KB 128.85% (🟢 -0.14%)
/apps/installed/[category] 282.48 KB 470.77 KB 134.51% (🟢 -0.15%)
/availability 436 KB 624.29 KB 178.37% (🟢 -0.15%)
/availability/[schedule] 362.49 KB 550.78 KB 157.37% (🟢 -0.15%)
/bookings/[status] 326.66 KB 514.95 KB 147.13% (🟢 -0.15%)
/enterprise 258.83 KB 447.12 KB 127.75% (🟢 -0.15%)
/event-types 557.86 KB 746.15 KB 213.19% (🟢 -0.15%)
/event-types/[type] 434.33 KB 622.62 KB 177.89% (🟢 -0.15%)
/insights 477.33 KB 665.62 KB 190.18% (🟢 -0.15%)
/more 258.04 KB 446.33 KB 127.52% (🟢 -0.14%)
/settings/admin 264.82 KB 453.11 KB 129.46% (🟢 -0.15%)
/settings/admin/apps 278.56 KB 466.85 KB 133.39% (🟢 -0.15%)
/settings/admin/apps/[category] 278.55 KB 466.84 KB 133.38% (🟢 -0.14%)
/settings/admin/flags 268.74 KB 457.03 KB 130.58% (🟢 -0.14%)
/settings/admin/impersonation 265.11 KB 453.4 KB 129.54% (🟢 -0.14%)
/settings/admin/oAuth 276.78 KB 465.07 KB 132.88% (🟢 -0.15%)
/settings/admin/orgMigrations/_OrgMigrationLayout 259.03 KB 447.32 KB 127.81% (🟢 -0.15%)
/settings/admin/orgMigrations/moveTeamToOrg 274.4 KB 462.69 KB 132.20% (🟢 -0.15%)
/settings/admin/orgMigrations/moveUserToOrg 293.1 KB 481.39 KB 137.54% (🟢 -0.14%)
/settings/admin/orgMigrations/removeTeamFromOrg 274.17 KB 462.46 KB 132.13% (🟢 -0.14%)
/settings/admin/orgMigrations/removeUserFromOrg 274.19 KB 462.47 KB 132.14% (🟢 -0.15%)
/settings/admin/organizations 266.84 KB 455.13 KB 130.04% (🟢 -0.15%)
/settings/admin/organizations/[id]/edit 265.36 KB 453.64 KB 129.61% (🟢 -0.14%)
/settings/admin/users 267.51 KB 455.8 KB 130.23% (🟢 -0.15%)
/settings/admin/users/[id]/edit 367.03 KB 555.32 KB 158.66% (🟢 -0.14%)
/settings/admin/users/add 366.77 KB 555.06 KB 158.59% (🟢 -0.15%)
/settings/billing 265.16 KB 453.45 KB 129.56% (🟢 -0.15%)
/settings/developer/api-keys 269.35 KB 457.64 KB 130.76% (🟢 -0.15%)
/settings/developer/webhooks 269.28 KB 457.57 KB 130.73% (🟢 -0.14%)
/settings/developer/webhooks/[id] 270.3 KB 458.59 KB 131.03% (🟢 -0.15%)
/settings/developer/webhooks/new 270.36 KB 458.64 KB 131.04% (🟢 -0.14%)
/settings/my-account/appearance 288.78 KB 477.07 KB 136.30% (🟢 -0.14%)
/settings/my-account/calendars 276.38 KB 464.67 KB 132.76% (🟢 -0.14%)
/settings/my-account/conferencing 277.11 KB 465.4 KB 132.97% (🟢 -0.14%)
/settings/my-account/general 353.12 KB 541.41 KB 154.69% (🟢 -0.15%)
/settings/my-account/out-of-office 269.12 KB 457.41 KB 130.69% (🟢 -0.15%)
/settings/my-account/profile 407.54 KB 595.82 KB 170.24% (🟢 -0.15%)
/settings/organizations/appearance 288.28 KB 476.57 KB 136.16% (🟢 -0.14%)
/settings/organizations/billing 265.19 KB 453.48 KB 129.57% (🟢 -0.15%)
/settings/organizations/general 345.66 KB 533.95 KB 152.56% (🟢 -0.15%)
/settings/organizations/members 438.47 KB 626.76 KB 179.07% (🟢 -0.14%)
/settings/organizations/profile 399.03 KB 587.31 KB 167.80% (🟢 -0.14%)
/settings/organizations/teams/other 265.86 KB 454.15 KB 129.76% (🟢 -0.15%)
/settings/organizations/teams/other/[id]/appearance 277.37 KB 465.66 KB 133.04% (🟢 -0.14%)
/settings/organizations/teams/other/[id]/members 272.32 KB 460.61 KB 131.60% (🟢 -0.14%)
/settings/organizations/teams/other/[id]/profile 470.59 KB 658.88 KB 188.25% (🟢 -0.14%)
/settings/security/impersonation 270.26 KB 458.55 KB 131.01% (🟢 -0.14%)
/settings/security/password 279.33 KB 467.62 KB 133.61% (🟢 -0.15%)
/settings/security/sso 275.3 KB 463.59 KB 132.46% (🟢 -0.15%)
/settings/security/two-factor-auth 273.84 KB 462.13 KB 132.04% (🟢 -0.15%)
/settings/teams 264.56 KB 452.85 KB 129.39% (🟢 -0.15%)
/settings/teams/[id]/appearance 277.35 KB 465.64 KB 133.04% (🟢 -0.14%)
/settings/teams/[id]/billing 265.19 KB 453.48 KB 129.57% (🟢 -0.15%)
/settings/teams/[id]/members 384.14 KB 572.43 KB 163.55% (🟢 -0.14%)
/settings/teams/[id]/profile 471.41 KB 659.7 KB 188.49% (🟢 -0.15%)
/settings/teams/[id]/sso 275.83 KB 464.11 KB 132.60% (🟢 -0.14%)
/settings/teams/new 198.58 KB 386.87 KB 110.53% (🟢 -0.14%)
/teams 258.25 KB 446.54 KB 127.58% (🟢 -0.14%)
/upgrade 258.48 KB 446.77 KB 127.65% (🟢 -0.15%)
/workflows 289.75 KB 478.04 KB 136.58% (🟢 -0.14%)
/workflows/[workflow] 410.44 KB 598.73 KB 171.07% (🟢 -0.15%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/-

github-actions[bot] avatar Feb 14 '24 08:02 github-actions[bot]

Current Playwright Test Results Summary

✅ 50 Passing - ⚠️ 1 Flaky

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

(Last updated on 03/05/2024 05:06:41pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 8e1f1e29494d6c2bcd2a7c27ca47f6d08f311dd7

Started: 03/05/2024 05:04:11pm UTC

⚠️ Flakes

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Update Profile Can resend verification link if the secondary email is unverified
Retry 2Retry 1Initial Attempt
12.12% (8) 8 / 66 runs
failed over last 7 days
36.36% (24) 24 / 66 runs
flaked over last 7 days

View Detailed Build Results


deploysentinel[bot] avatar Feb 14 '24 08:02 deploysentinel[bot]

Graphite Automations

A Graphite automation took an action on this PR • (02/15/24)

1 reviewer was added based on Keith Williams's automation, 'Add consumer team as reviewer'

graphite-app[bot] avatar Feb 15 '24 06:02 graphite-app[bot]

Overall this PR makes sense. I'm just wondering when does a username become available in the global space once it's been migrated over to an org?

It is right now applicable to hundreds of users that were migrated before the new org schema.

hariombalhara avatar Feb 17 '24 09:02 hariombalhara

Didn't get your question fully? Could you share an example maybe of what you are asking.

--Edit

I think I get it now. Which kind of test we are talking about here? I think I had a test somewhere for booking pages which tests the entire invite flow and accepting the invitation in which case the username should be different in global and org namespace.

hariombalhara avatar Feb 19 '24 17:02 hariombalhara

@joeauyeung I fixed the merged conflicts.

keithwillcode avatar Mar 05 '24 14:03 keithwillcode