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: team invite signup not working #13717

Merged
merged 3 commits into from
Feb 16, 2024
Merged

Conversation

hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Feb 16, 2024

What does this PR do?

Fixes #13719

Type of change

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

How should this be tested?

Mandatory Tasks

  • 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

NOTE: It isn't possible to test this flow using e2e

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 consumer core area: core, team members only labels Feb 16, 2024
@@ -235,10 +235,11 @@ export async function createNewUsersConnectToOrgIfExists({
const usernameOrEmail = usernamesOrEmails[index];
const { orgId, autoAccept } = connectionInfoMap[usernameOrEmail];
const [emailUser, emailDomain] = usernameOrEmail.split("@");
const username =
emailDomain === autoAcceptEmailDomain
const username = input.isOrg
Copy link
Member Author

Choose a reason for hiding this comment

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

For a non sub-team invite, we shouldn't set username during the invite as user is allowed to change the username during the signup.

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 16, 2024 0:24am
cal ⬜️ Ignored (Inspect) Visit Preview Feb 16, 2024 0:24am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Feb 16, 2024 0:24am
qa ⬜️ Ignored (Inspect) Visit Preview Feb 16, 2024 0:24am

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! 🙌

emailDomain === autoAcceptEmailDomain
? slugify(emailUser)
: slugify(`${emailUser}-${emailDomain.split(".")[0]}`);
input.isOrg || parentId
Copy link
Member Author

Choose a reason for hiding this comment

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

Ensures that for a regular team the username isn't set because user is allowed to change the username during signup in that context.

@hariombalhara hariombalhara changed the title Fix team invite signup not working fix: team invite signup not working Feb 16, 2024
Copy link

deploysentinel bot commented Feb 16, 2024

Current Playwright Test Results Summary

✅ 63 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/16/2024 12:49:15pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 7284929

Started: 02/16/2024 12:46:48pm UTC

⚠️ Flakes

📄   apps/web/playwright/profile.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
Update Profile Cannot update a users email when existing user has same email (verification enabled)
Retry 1Initial Attempt
0.39% (1) 1 / 256 run
failed over last 7 days
49.61% (127) 127 / 256 runs
flaked over last 7 days
Update Profile Can update a users email (verification enabled)
Retry 2Retry 1Initial Attempt
12.11% (31) 31 / 256 runs
failed over last 7 days
51.56% (132) 132 / 256 runs
flaked over last 7 days

View Detailed Build Results


@hariombalhara hariombalhara marked this pull request as ready for review February 16, 2024 07:36
@graphite-app graphite-app bot requested a review from a team February 16, 2024 07:36
@hariombalhara hariombalhara requested review from ThyMinimalDev and a team and removed request for a team February 16, 2024 07:36
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 consumer team as reviewer'

emailDomain === autoAcceptEmailDomain
? slugify(emailUser)
: slugify(`${emailUser}-${emailDomain.split(".")[0]}`);

// As a regular team member is allowed to change username during signup, we don't set any username for him
const regularTeamMemberUsername = null;
Copy link
Member Author

Choose a reason for hiding this comment

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

I think we accidentally started setting it for regular teams by this PR
https://github.com/calcom/cal.com/pull/11238/files
cc @joeauyeung for confirmation

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. Regular Team invites are working fine.

Checking orgs now

@Udit-takkar Udit-takkar enabled auto-merge (squash) February 16, 2024 12:28
@Udit-takkar Udit-takkar merged commit ff6db3c into main Feb 16, 2024
38 checks passed
@Udit-takkar Udit-takkar deleted the fix-team-invite-calcom-handler branch February 16, 2024 12:50
keithwillcode pushed a commit that referenced this pull request Feb 16, 2024
* Fix team invite signup not working

* Add unit test

---------

Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working consumer core area: core, team members only High priority Created by Linear-GitHub Sync teams area: teams, round robin, collective, managed event-types Urgent Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3153] A regular team invite link doesn't let the user signup.
4 participants