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: Across Org Scenarios - Wrong links for event and team #12358

Merged
merged 12 commits into from
Dec 19, 2023

Conversation

hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Nov 14, 2023

What does this PR do?

This PR makes it more reliable to do partial migration of users or teams to an org so that during the migration there is no disruption of services even if the migration is really gradual.

Fixes #12002

  • Wrong Avatar in Managed Event Type Assignment if the user isn't part of org - Started using non org link for avatar with orgId as param here also.
  • Wrong Avatar in Create EventType, Workflow, RoutingForm dropdowns - Similar to the fix for the previous point.
  • Booking a non-org team event that has an org member as the organizer was sending the wrong link in email for reschedule and cancel - Started using event to identify the domain instead of using the organizer.
    • [Test] Added bookingScenario test for this.
  • Team Profile in dashboard was showing wrong URL for a team that was part of Org but the user seeing the page wasn't part of the org - Started using the team's parent to determine the domain instead of the logged In user.
    • [Test] Added an e2e for this.
  • On /event-types, a non-org member(part of a team in an org) was seeing wrong link to the team events Fixes [CAL-2692] A non-migrated(to Org) user is seeing wrong link for team events that he is part of. #12317
    • [Test] Added an e2e for this
  • Other team members page was showing wrong avatar and links. Fixed that

Type of change

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

Test Results

https://github.com/calcom/cal.com/actions/runs/7258635346

How should this be tested?

See this loom

Mandatory Tasks

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

Copy link

vercel bot commented Nov 14, 2023

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

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2023 8:14am
cal-demo 🔄 Building (Inspect) Visit Preview 💬 Add feedback Dec 19, 2023 8:14am
dev 🛑 Canceled (Inspect) Dec 19, 2023 8:14am
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 8:14am
cal ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 8:14am
qa ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 8:14am
ui ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 8:14am

@hariombalhara
Copy link
Member Author

hariombalhara commented Nov 14, 2023

Copy link
Contributor

github-actions bot commented Nov 14, 2023

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

Copy link
Contributor

github-actions bot commented Nov 14, 2023

📦 Next.js Bundle Analysis for @calcom/web

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

One Page Changed Size

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

Page Size (compressed) First Load % of Budget (350 KB)
/settings/teams/new 188.6 KB 351.67 KB 100.48% (🟡 +2.01%)
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 "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Copy link

deploysentinel bot commented Nov 14, 2023

Current Playwright Test Results Summary

✅ 309 Passing - ⚠️ 11 Flaky

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

(Last updated on 12/19/2023 07:56:41am UTC)

Run Details

Running Workflow Pre-release checks on Github Actions

Commit: 5c45b9d

Started: 12/19/2023 07:47:47am UTC

⚠️ Flakes

📄   apps/web/playwright/organization/organization-invitation.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
Organization Email not matching orgAutoAcceptEmail Org Invitation
Retry 1Initial Attempt
-100% (-32) -32 / 32 runs
failed over last 7 days
112.50% (36) 36 / 32 runs
flaked over last 7 days
Organization Email not matching orgAutoAcceptEmail Team invitation
Retry 1Initial Attempt
-85.71% (-24) -24 / 28 runs
failed over last 7 days
110.71% (31) 31 / 28 runs
flaked over last 7 days
Organization Email matching orgAutoAcceptEmail and a Verified Organization Org Invitation
Retry 1Initial Attempt
-38.10% (-8) -8 / 21 runs
failed over last 7 days
85.71% (18) 18 / 21 runs
flaked over last 7 days
Organization Email matching orgAutoAcceptEmail and a Verified Organization Team Invitation
Retry 1Initial Attempt
-100% (-11) -11 / 11 runs
failed over last 7 days
136.36% (15) 15 / 11 runs
flaked over last 7 days

📄   apps/web/playwright/organization/organization-creation.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Organization should be able to create an organization and complete onboarding
Retry 1Initial Attempt
15.30% (41) 41 / 268 runs
failed over last 7 days
47.39% (127) 127 / 268 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/preview.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Preview Preview - embed-core should load
Retry 1Initial Attempt
0% (0) 0 / 263 runs
failed over last 7 days
21.67% (57) 57 / 263 runs
flaked over last 7 days

📄   apps/web/playwright/organization/across-org/across-org.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
user1NotMemberOfOrg1 is part of team1MemberOfOrg1 EventTypes listing should show correct link for user events and team1MemberOfOrg1's events
Retry 1Initial Attempt
0% (0) 0 / 2 runs
failed over last 7 days
50% (1) 1 / 2 run
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
2FA Tests should allow a user to enable 2FA and login using 2FA
Retry 1Initial Attempt
0.77% (2) 2 / 261 runs
failed over last 7 days
32.18% (84) 84 / 261 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.26% (11) 11 / 258 runs
failed over last 7 days
93.02% (240) 240 / 258 runs
flaked over last 7 days
Team Invitation (verified)
Retry 1Initial Attempt
0% (0) 0 / 258 runs
failed over last 7 days
94.96% (245) 245 / 258 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should be able to reschedule
Retry 1Initial Attempt
15.47% (41) 41 / 265 runs
failed over last 7 days
78.11% (207) 207 / 265 runs
flaked over last 7 days

View Detailed Build Results


@hariombalhara hariombalhara changed the base branch from main to 11-02-Fix_team_with_same_name_as_slug_not_loading November 14, 2023 10:29
@hariombalhara hariombalhara force-pushed the 11-14-fix_Wrong_links_for_event_and_team branch from 6f733b0 to 5284906 Compare November 14, 2023 10:29
@hariombalhara hariombalhara force-pushed the 11-14-fix_Wrong_links_for_event_and_team branch from 5284906 to a2865aa Compare November 14, 2023 11:38
Base automatically changed from 11-02-Fix_team_with_same_name_as_slug_not_loading to main November 14, 2023 12:55
@hariombalhara hariombalhara force-pushed the 11-14-fix_Wrong_links_for_event_and_team branch from a2865aa to 7477970 Compare November 14, 2023 13:03
@hariombalhara hariombalhara force-pushed the 11-14-fix_Wrong_links_for_event_and_team branch from 7477970 to 3471842 Compare November 15, 2023 07:05
@@ -291,7 +303,6 @@ export const getByViewerHandler = async ({ ctx, input }: GetByViewerOptions) =>
...group.metadata,
teamId: group.teamId,
membershipRole: group.membershipRole,
image: `${bookerUrl}/${group.profile.slug}/avatar.png`,
Copy link
Member Author

Choose a reason for hiding this comment

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

No need to set it here, we are already setting it in the above code

sean-brydon
sean-brydon previously approved these changes Dec 19, 2023
Copy link
Member

@sean-brydon sean-brydon left a comment

Choose a reason for hiding this comment

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

Tested locally and can confirm all links for eventTypes and avatars for users in a team not in an org appears to be correct.

Great work this must not have been easy to get your head around. Code looks great. Amazing coverage with the tests too!

packages/lib/getBookerUrl/client.ts Outdated Show resolved Hide resolved
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
@hariombalhara hariombalhara enabled auto-merge (squash) December 19, 2023 07:20
sean-brydon
sean-brydon previously approved these changes Dec 19, 2023
@hariombalhara hariombalhara merged commit e5e0fa9 into main Dec 19, 2023
44 of 46 checks passed
@hariombalhara hariombalhara deleted the 11-14-fix_Wrong_links_for_event_and_team branch December 19, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge core area: core, team members only Medium priority Created by Linear-GitHub Sync organizations area: organizations, orgs
Projects
None yet
6 participants