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: Minimum fix for N Calendar Invites #14617

Merged
merged 3 commits into from Apr 16, 2024

Conversation

joeauyeung
Copy link
Contributor

What does this PR do?

Right now attendees are being spammed by emails from the calendar provider because we were creating calendar events on EACH team member's calendars. So if we have 4 members in a collective event, we were creating 4 different calendar events and the attendee was receiving an email for each event.

This PR is a minimum fix for this bug by only creating one calendar event on the first destination calendar that appears.

I tested this with a collective event and all team members are still on the single calendar event and is pointing to the member's destination calendar.

We should follow up with the changes found in this PR #14610 once tests are created for the EventManager class.

Fixes #14580 Fixes CAL-3412 Fixes CAL-3468

Requirement/Documentation

  • If there is a requirement document, please, share it here.
  • If there is a UI/UX design document, please, share it here.

Type of change

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

How should this be tested?

  • Create a collective team event with each team member having Outlook as a destination calendar
  • Create a booking under the collective event
  • The attendee should receive one email from Outlook and all team members should be invited to the event

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
  • I haven't checked if new and existing unit tests pass locally with my changes

@graphite-app graphite-app bot requested a review from a team April 16, 2024 19:34
@github-actions github-actions bot added consumer emails area: emails, cancellation email, reschedule email, inbox, spam folder, not getting email teams area: teams, round robin, collective, managed event-types Urgent Created by Linear-GitHub Sync 🐛 bug Something isn't working labels Apr 16, 2024
Copy link
Contributor

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

@dosubot dosubot bot added the bookings area: bookings, availability, timezones, double booking label Apr 16, 2024
@keithwillcode keithwillcode added the core area: core, team members only label Apr 16, 2024
Copy link

graphite-app bot commented Apr 16, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (04/16/24)

1 reviewer was added to this PR based on Keith Williams's automation.

@@ -554,6 +555,7 @@ export default class EventManager {
[] as DestinationCalendar[]
);
for (const destination of destinationCalendars) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This for ... of loop was the cause of creating multiple calendar events.

@@ -554,6 +555,7 @@ export default class EventManager {
[] as DestinationCalendar[]
);
for (const destination of destinationCalendars) {
if (eventCreated) break;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If a calendar event was created then set eventCreated to true. If the event was created on the first destination calendar then break out of the loop.

Copy link
Member

@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.

Way way clearer. Thanks a ton @joeauyeung

Ship it

@joeauyeung joeauyeung enabled auto-merge (squash) April 16, 2024 19:41
@joeauyeung joeauyeung enabled auto-merge (squash) April 16, 2024 19:42
Copy link
Contributor

github-actions bot commented Apr 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! 🙌

Copy link

deploysentinel bot commented Apr 16, 2024

Current Playwright Test Results Summary

✅ 302 Passing - ⚠️ 17 Flaky

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

(Last updated on 04/16/2024 08:04:24pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 1a0707c

Started: 04/16/2024 08:00:11pm UTC

⚠️ Flakes

📄   apps/web/playwright/event-types.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
Event Types tests -- future user Different Locations Tests can add Attendee Phone Number location and book with it
Retry 1Initial Attempt
0.67% (2) 2 / 300 runs
failed over last 7 days
4.67% (14) 14 / 300 runs
flaked over last 7 days
Event Types tests -- legacy user can add multiple organizer address
Retry 1Initial Attempt
0% (0) 0 / 295 runs
failed over last 7 days
2.71% (8) 8 / 295 runs
flaked over last 7 days

📄   apps/web/playwright/teams.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
Teams - NonOrg -- future Team Onboarding Invite Members
Retry 1Initial Attempt
7.74% (24) 24 / 310 runs
failed over last 7 days
37.42% (116) 116 / 310 runs
flaked over last 7 days
Teams - NonOrg -- future Can create a booking for Round Robin EventType
Retry 1Initial Attempt
0.96% (3) 3 / 311 runs
failed over last 7 days
1.93% (6) 6 / 311 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Availablity Can manage single schedule
Retry 1Initial Attempt
0.65% (2) 2 / 306 runs
failed over last 7 days
25.82% (79) 79 / 306 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Organization Email matching orgAutoAcceptEmail and a Verified Organization with DNS Setup Done nonexisting user is invited to Org
Retry 1Initial Attempt
0.34% (1) 1 / 297 run
failed over last 7 days
7.41% (22) 22 / 297 runs
flaked over last 7 days

📄   apps/web/playwright/integrations-stripe.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Stripe integration Can book a paid booking
Retry 1Initial Attempt
5.56% (17) 17 / 306 runs
failed over last 7 days
38.56% (118) 118 / 306 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Bookings Team Event Can create a booking for Round Robin EventType
Retry 2Retry 1Initial Attempt
0.98% (3) 3 / 307 runs
failed over last 7 days
1.63% (5) 5 / 307 runs
flaked over last 7 days

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

Top 1 Common Error Messages

null

8 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
0.34% (1) 1 / 294 run
failed over last 7 days
64.97% (191) 191 / 294 runs
flaked over last 7 days
Popup Tests should be able to reschedule
Retry 1Initial Attempt
-189.11% (-191) -191 / 101 runs
failed over last 7 days
189.11% (191) 191 / 101 runs
flaked over last 7 days
Popup Tests should open Routing Forms embed on click
Retry 1Initial Attempt
-189.11% (-191) -191 / 101 runs
failed over last 7 days
189.11% (191) 191 / 101 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
-187.13% (-189) -189 / 101 runs
failed over last 7 days
188.12% (190) 190 / 101 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
-190% (-190) -190 / 100 runs
failed over last 7 days
190% (190) 190 / 100 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
-190% (-190) -190 / 100 runs
failed over last 7 days
190% (190) 190 / 100 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
-190% (-190) -190 / 100 runs
failed over last 7 days
190% (190) 190 / 100 runs
flaked over last 7 days
Popup Tests prendered embed should be loaded and apply the config given to it
Retry 1Initial Attempt
-190% (-190) -190 / 100 runs
failed over last 7 days
190% (190) 190 / 100 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 Test preview should return correct route
Retry 1Initial Attempt
0.68% (2) 2 / 295 runs
failed over last 7 days
36.27% (107) 107 / 295 runs
flaked over last 7 days

View Detailed Build Results


@joeauyeung joeauyeung merged commit cebbffe into main Apr 16, 2024
38 of 39 checks passed
@joeauyeung joeauyeung deleted the remove-member-destination-calendars branch April 16, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookings area: bookings, availability, timezones, double booking 🐛 bug Something isn't working consumer core area: core, team members only emails area: emails, cancellation email, reschedule email, inbox, spam folder, not getting email 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-3412] a collective event of N people sends N invites
3 participants