Skip to content

fix: Booker fix for team + user with same event + event slug#9654

Merged
hariombalhara merged 5 commits intomainfrom
fix/prevent-same-slugs-from-breaking-booker
Jun 21, 2023
Merged

fix: Booker fix for team + user with same event + event slug#9654
hariombalhara merged 5 commits intomainfrom
fix/prevent-same-slugs-from-breaking-booker

Conversation

@JeroenReumkens
Copy link
Copy Markdown
Contributor

What does this PR do?

If there would a user that was part of a team that had the exact same slug as the user, AND also both the team and the user have an event with te same slug, it would show the user event on the team page.

This PR changes that behaviour. Now we have the option in the booker the force it the only fetch a team event. That boolean is passed on the team pages, which results in the query only fetching team events, instead of running an OR query and fetching the first match.

Fixes #8579

Type of change

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

How should this be tested?

  • Login with team pro, change their profile slug to seeded. Go to the seeded team page and change the slug to seeded too. Then create an event in both the team and the teampro-profile with a slug test. With the changes in this PR, it should simply show both event pages correctly.

… team have the same slug AND the same event with same slug
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 20, 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 Jun 21, 2023 7:03am
cal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2023 7:03am
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2023 7:03am
web-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2023 7:03am

@github-actions github-actions Bot added booking-page area: booking page, public booking page, booker Low priority Created by Linear-GitHub Sync 🐛 bug Something isn't working labels Jun 20, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 20, 2023

Thank you for following the naming conventions! 🙏

rescheduleBooking={booking}
isAway={away}
hideBranding={isBrandingHidden}
isTeamEvent
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

New boolean in booker that can now force it to only fetch team events.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We would probably have to do it for private links as well. A private link can be a team event or user event.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added it, great suggestion!

useEffect(() => {
initializeStore({ username, eventSlug, month, eventId, rescheduleUid, rescheduleBooking, layout });
}, [initializeStore, username, eventSlug, month, eventId, rescheduleUid, rescheduleBooking, layout]);
initializeStore({
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Prettier did it's thing. The isTeamEvent boolean is added to the effect here.

*/
export const useEvent = () => {
const [username, eventSlug] = useBookerStore((state) => [state.username, state.eventSlug], shallow);
const isTeamEvent = useBookerStore((state) => state.isTeamEvent);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the useEvent hook takes the isTeamEvent boolean from the store and automatically passes that to the query so it fetches the right data.

Comment thread packages/features/eventtypes/lib/getPublicEvent.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 20, 2023

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

@deploysentinel
Copy link
Copy Markdown

deploysentinel Bot commented Jun 20, 2023

Current Playwright Test Results Summary

✅ 109 Passing - ❌ 4 Failing - ⚠️ 3 Flaky

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

(Last updated on 06/21/2023 06:59:27am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 9630161

Started: 06/21/2023 06:57:31am UTC

❌ Failures

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 3 Failures

Top 1 Common Error Messages

Expected to provide an iframe, got null

2 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
Error: Expected to provide an iframe, got null
Expected to provide an iframe, got null
15.98% (31) 31 / 194 runs
failed over last 7 days
8.25% (16) 16 / 194 runs
flaked over last 7 days
Popup Tests should be able to reschedule
Retry 2Retry 1Initial Attempt
Error: Expected to provide an iframe, got null
Expected to provide an iframe, got null
16.49% (32) 32 / 194 runs
failed over last 7 days
79.90% (155) 155 / 194 runs
flaked over last 7 days
Popup Tests should open Routing Forms embed on click
Retry 1Initial Attempt
Error: Routing Form embed iframe not found
Routing Form embed iframe not found
13.92% (27) 27 / 194 runs
failed over last 7 days
0.52% (1) 1 / 194 run
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/inline.e2e.ts • 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Inline Iframe - Configured with Dark Theme
Retry 2Retry 1Initial Attempt
Error: Embed iframe not found
Embed iframe not found
15.98% (31) 31 / 194 runs
failed over last 7 days
1.03% (2) 2 / 194 runs
flaked over last 7 days

⚠️ Flakes

📄   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 user -- old-booker can add multiple organizer address
Retry 1Initial Attempt
3.40% (10) 10 / 294 runs
failed over last 7 days
30.61% (90) 90 / 294 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
pro user -- new-booker can book an event that requires confirmation and then that booking can be accepted by organizer
Retry 1Initial Attempt
0.33% (1) 1 / 300 run
failed over last 7 days
0.67% (2) 2 / 300 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking with Seats -- new-booker Attendees can cancel a seated event time slot
Retry 1Initial Attempt
0.98% (3) 3 / 307 runs
failed over last 7 days
5.54% (17) 17 / 307 runs
flaked over last 7 days

View Detailed Build Results


Comment thread packages/features/eventtypes/lib/getPublicEvent.ts
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

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

Requested one change. Otherwise looks good.
Renamed seeded-team slug to teampro and then did the following tests

  • Visited /new-booker/teampro/30min - Serves user event.
  • Visited /new-booker/team/teampro/30min(after creating 30min event in Seeded Team). Serves team event.

@JeroenReumkens
Copy link
Copy Markdown
Contributor Author

Requested one change. Otherwise looks good. Renamed seeded-team slug to teampro and then did the following tests

  • Visited /new-booker/teampro/30min - Serves user event.
  • Visited /new-booker/team/teampro/30min(after creating 30min event in Seeded Team). Serves team event.

Thanks a lot for testing! Just fixed your suggested changing. Re-requesting review 😁

@hariombalhara hariombalhara merged commit ab6781c into main Jun 21, 2023
@hariombalhara hariombalhara deleted the fix/prevent-same-slugs-from-breaking-booker branch June 21, 2023 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

booking-page area: booking page, public booking page, booker 🐛 bug Something isn't working Low priority Created by Linear-GitHub Sync

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

[CAL-1606] New Booker: Shows team event in place of user event if both have same slugs.

2 participants