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: trigger workflow only for first recurring event #15128

Merged
merged 4 commits into from
Jun 6, 2024

Conversation

CarinaWolli
Copy link
Member

What does this PR do?

This fixes that a workflow with the 'when new event is booked' trigger is only triggered for the first recurring event

@graphite-app graphite-app bot requested a review from a team May 20, 2024 14:00
Copy link
Contributor

github-actions bot commented May 20, 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 May 20, 2024
@dosubot dosubot bot added bookings area: bookings, availability, timezones, double booking 🐛 bug Something isn't working labels May 20, 2024
@CarinaWolli CarinaWolli added this to the v4.2 milestone May 20, 2024
@CarinaWolli CarinaWolli added the High priority Created by Linear-GitHub Sync label May 20, 2024
Copy link

vercel bot commented May 20, 2024

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

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 9:45am
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview May 31, 2024 9:45am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview May 31, 2024 9:45am

Copy link

graphite-app bot commented May 20, 2024

Graphite Automations

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

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

Copy link
Contributor

github-actions bot commented May 20, 2024

📦 Next.js Bundle Analysis for @calcom/web

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

Eighty-one 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)
/[user]/[type] 412.21 KB 640.76 KB 183.07% (🟢 -0.25%)
/[user]/[type]/embed 412.21 KB 640.76 KB 183.07% (🟢 -0.24%)
/apps 280.25 KB 508.8 KB 145.37% (🟢 -0.24%)
/apps/[slug] 297.75 KB 526.3 KB 150.37% (🟢 -0.24%)
/apps/[slug]/[...pages] 588.76 KB 817.32 KB 233.52% (🟢 -0.24%)
/apps/categories 257.98 KB 486.53 KB 139.01% (🟢 -0.24%)
/apps/categories/[category] 262.33 KB 490.88 KB 140.25% (🟢 -0.24%)
/apps/installed/[category] 281.52 KB 510.07 KB 145.73% (🟢 -0.24%)
/auth/platform/authorize 87.25 KB 315.8 KB 90.23% (🟢 -0.26%)
/availability 429 KB 657.55 KB 187.87% (🟢 -0.24%)
/availability/[schedule] 412.74 KB 641.29 KB 183.23% (🟢 -0.24%)
/bookings/[status] 325.8 KB 554.35 KB 158.39% (🟢 -0.25%)
/d/[link]/[slug] 412.01 KB 640.57 KB 183.02% (🟢 -0.25%)
/enterprise 258.04 KB 486.59 KB 139.03% (🟢 -0.25%)
/event-types 557.75 KB 786.3 KB 224.66% (🟢 -0.25%)
/event-types/[type] 437.64 KB 666.2 KB 190.34% (🟢 -0.24%)
/insights 476.95 KB 705.5 KB 201.57% (🟢 -0.24%)
/more 257.55 KB 486.1 KB 138.89% (🟢 -0.25%)
/org/[orgSlug]/[user]/[type] 412.41 KB 640.96 KB 183.13% (🟢 -0.25%)
/org/[orgSlug]/[user]/[type]/embed 412.43 KB 640.98 KB 183.14% (🟢 -0.25%)
/org/[orgSlug]/instant-meeting/team/[slug]/[type] 412.03 KB 640.58 KB 183.02% (🟢 -0.24%)
/org/[orgSlug]/team/[slug]/[type] 412.23 KB 640.78 KB 183.08% (🟢 -0.25%)
/settings/admin 263.64 KB 492.19 KB 140.63% (🟢 -0.25%)
/settings/admin/apps 276.77 KB 505.33 KB 144.38% (🟢 -0.24%)
/settings/admin/apps/[category] 276.76 KB 505.31 KB 144.37% (🟢 -0.24%)
/settings/admin/flags 267.75 KB 496.3 KB 141.80% (🟢 -0.24%)
/settings/admin/impersonation 264.13 KB 492.68 KB 140.76% (🟢 -0.24%)
/settings/admin/lockedSMS 284.81 KB 513.36 KB 146.67% (🟢 -0.24%)
/settings/admin/oAuth 275.8 KB 504.35 KB 144.10% (🟢 -0.24%)
/settings/admin/orgMigrations/_OrgMigrationLayout 252.55 KB 481.11 KB 137.46% (🟢 -0.24%)
/settings/admin/orgMigrations/moveTeamToOrg 301.71 KB 530.26 KB 151.50% (🟢 -0.24%)
/settings/admin/orgMigrations/moveUserToOrg 321.13 KB 549.68 KB 157.05% (🟢 -0.25%)
/settings/admin/orgMigrations/removeTeamFromOrg 301.45 KB 530.01 KB 151.43% (🟢 -0.24%)
/settings/admin/orgMigrations/removeUserFromOrg 301.47 KB 530.02 KB 151.43% (🟢 -0.24%)
/settings/admin/organizations 265.21 KB 493.76 KB 141.07% (🟢 -0.24%)
/settings/admin/organizations/[id]/edit 264.02 KB 492.58 KB 140.74% (🟢 -0.25%)
/settings/admin/users 265.89 KB 494.44 KB 141.27% (🟢 -0.24%)
/settings/admin/users/[id]/edit 394.57 KB 623.12 KB 178.03% (🟢 -0.24%)
/settings/admin/users/add 394.3 KB 622.85 KB 177.96% (🟢 -0.25%)
/settings/billing 263.74 KB 492.3 KB 140.66% (🟢 -0.25%)
/settings/developer/api-keys 267.8 KB 496.35 KB 141.82% (🟢 -0.25%)
/settings/developer/webhooks 267.89 KB 496.45 KB 141.84% (🟢 -0.24%)
/settings/developer/webhooks/[id] 268.89 KB 497.44 KB 142.13% (🟢 -0.25%)
/settings/developer/webhooks/new 268.89 KB 497.44 KB 142.13% (🟢 -0.25%)
/settings/my-account/appearance 316.6 KB 545.15 KB 155.76% (🟢 -0.24%)
/settings/my-account/calendars 274.32 KB 502.87 KB 143.68% (🟢 -0.24%)
/settings/my-account/conferencing 275.59 KB 504.14 KB 144.04% (🟢 -0.24%)
/settings/my-account/general 379.52 KB 608.07 KB 173.74% (🟢 -0.25%)
/settings/my-account/out-of-office 268.42 KB 496.97 KB 141.99% (🟢 -0.24%)
/settings/my-account/profile 407.06 KB 635.62 KB 181.60% (🟢 -0.24%)
/settings/organizations/admin-api 263.65 KB 492.2 KB 140.63% (🟢 -0.24%)
/settings/organizations/appearance 287.7 KB 516.25 KB 147.50% (🟢 -0.24%)
/settings/organizations/billing 263.83 KB 492.38 KB 140.68% (🟢 -0.24%)
/settings/organizations/dsync 295.93 KB 524.48 KB 149.85% (🟢 -0.24%)
/settings/organizations/general 351.5 KB 580.05 KB 165.73% (🟢 -0.24%)
/settings/organizations/members 401.28 KB 629.83 KB 179.95% (🟢 -0.24%)
/settings/organizations/privacy 269.41 KB 497.96 KB 142.28% (🟢 -0.25%)
/settings/organizations/profile 399.82 KB 628.37 KB 179.53% (🟢 -0.24%)
/settings/organizations/sso 274.49 KB 503.04 KB 143.73% (🟢 -0.25%)
/settings/organizations/teams/other 264.4 KB 492.95 KB 140.84% (🟢 -0.24%)
/settings/organizations/teams/other/[id]/appearance 276.54 KB 505.09 KB 144.31% (🟢 -0.24%)
/settings/organizations/teams/other/[id]/members 271.49 KB 500.04 KB 142.87% (🟢 -0.24%)
/settings/organizations/teams/other/[id]/profile 470.63 KB 699.18 KB 199.77% (🟢 -0.25%)
/settings/platform 262.02 KB 490.57 KB 140.16% (🟢 -0.26%)
/settings/platform/oauth-clients/[clientId]/edit 260.6 KB 489.15 KB 139.76% (🟢 -0.30%)
/settings/platform/oauth-clients/create 259.78 KB 488.33 KB 139.52% (🟢 -0.28%)
/settings/security/impersonation 268.65 KB 497.2 KB 142.06% (🟢 -0.24%)
/settings/security/password 306.21 KB 534.77 KB 152.79% (🟢 -0.24%)
/settings/security/sso 273.82 KB 502.37 KB 143.53% (🟢 -0.24%)
/settings/security/two-factor-auth 272.08 KB 500.63 KB 143.04% (🟢 -0.25%)
/settings/teams 263.31 KB 491.86 KB 140.53% (🟢 -0.24%)
/settings/teams/[id]/appearance 276.52 KB 505.07 KB 144.31% (🟢 -0.25%)
/settings/teams/[id]/billing 263.82 KB 492.38 KB 140.68% (🟢 -0.24%)
/settings/teams/[id]/members 381.52 KB 610.07 KB 174.31% (🟢 -0.25%)
/settings/teams/[id]/profile 471.46 KB 700.02 KB 200.00% (🟢 -0.24%)
/team/[slug]/[type] 412.19 KB 640.75 KB 183.07% (🟢 -0.25%)
/team/[slug]/[type]/embed 412.22 KB 640.78 KB 183.08% (🟢 -0.25%)
/teams 257.77 KB 486.32 KB 138.95% (🟢 -0.24%)
/upgrade 257.89 KB 486.45 KB 138.98% (🟢 -0.24%)
/workflows 289.25 KB 517.8 KB 147.94% (🟢 -0.24%)
/workflows/[workflow] 411.67 KB 640.22 KB 182.92% (🟢 -0.39%)
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 May 20, 2024

Current Playwright Test Results Summary

✅ 319 Passing - ❌ 2 Failing - ⚠️ 12 Flaky

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

(Last updated on 05/21/2024 03:13:34pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 8d2d27e

Started: 05/21/2024 03:10:32pm UTC

❌ Failures

📄   apps/web/playwright/profile.e2e.ts • 2 Failures

Top 1 Common Error Messages

expect(received).toEqual(expected) // deep equality

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Update Profile Newly added secondary email should show as Unverified
Retry 2Retry 1Initial Attempt
Error: expect(received).toEqual(expected) // deep equality...
expect(received).toEqual(expected) // deep equality

Expected: true
Received: false
2.60% (7) 7 / 269 runs
failed over last 7 days
22.68% (61) 61 / 269 runs
flaked over last 7 days
Update Profile Can verify the newly added secondary email
Retry 2Retry 1Initial Attempt
Error: expect(received).toEqual(expected) // deep equality...
expect(received).toEqual(expected) // deep equality

Expected: true
Received: false
2.97% (8) 8 / 269 runs
failed over last 7 days
22.68% (61) 61 / 269 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 -- legacy user Different Locations Tests Can remove location from multiple locations that are saved
Retry 2Retry 1Initial Attempt
4.60% (11) 11 / 239 runs
failed over last 7 days
21.34% (51) 51 / 239 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 Paid booking should be able to be rescheduled
Retry 1Initial Attempt
5.91% (13) 13 / 220 runs
failed over last 7 days
15.91% (35) 35 / 220 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
user can login & logout succesfully -- future login flow user & logout using dashboard
Retry 2Retry 1Initial Attempt
4.18% (10) 10 / 239 runs
failed over last 7 days
35.56% (85) 85 / 239 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Workflow Tab - Event Type Check the functionalities of the Workflow Tab User Workflows Create an action and check if workflow is triggered
Retry 1Initial Attempt
2.51% (6) 6 / 239 runs
failed over last 7 days
2.51% (6) 6 / 239 runs
flaked over last 7 days

📄   apps/web/playwright/managed-event-types.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Managed Event Types Can create managed event type
Retry 1Initial Attempt
5.96% (14) 14 / 235 runs
failed over last 7 days
4.26% (10) 10 / 235 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 if correct embedLibUrl is provided
Retry 1Initial Attempt
0% (0) 0 / 229 runs
failed over last 7 days
32.31% (74) 74 / 229 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.43% (1) 1 / 232 run
failed over last 7 days
29.74% (69) 69 / 232 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
MEETING_ENDED, MEETING_STARTED should create/remove scheduledWebhookTriggers for existing bookings
Retry 1Initial Attempt
3.40% (8) 8 / 235 runs
failed over last 7 days
34.04% (80) 80 / 235 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Signup Flow Test Email verification sent if enabled
Retry 1Initial Attempt
0.81% (2) 2 / 246 runs
failed over last 7 days
28.46% (70) 70 / 246 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 Can create a booking for Round Robin EventType
Retry 1Initial Attempt
8.94% (22) 22 / 246 runs
failed over last 7 days
25.20% (62) 62 / 246 runs
flaked over last 7 days
Teams - NonOrg -- legacy Can create a booking for Round Robin EventType
Retry 1Initial Attempt
8.13% (20) 20 / 246 runs
failed over last 7 days
30.49% (75) 75 / 246 runs
flaked over last 7 days

📄   packages/embeds/embed-react/playwright/tests/basic.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
React Embed Element Click Popup should verify that the iframe got created with correct URL - namespaced
Retry 1Initial Attempt
20.55% (52) 52 / 253 runs
failed over last 7 days
33.99% (86) 86 / 253 runs
flaked over last 7 days

View Detailed Build Results


@Udit-takkar Udit-takkar self-requested a review May 21, 2024 07:12
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.

CleanShot 2024-05-21 at 11 11 23

Hey @CarinaWolli i just tested this and it doesnt seem to work as i am still getting all the emails per scheduled event - am i misunderstanding something

@@ -2385,7 +2385,7 @@ async function handler(
calendarEvent: evtWithMetadata,
isNotConfirmed: rescheduleUid ? false : !isConfirmedByDefault,
isRescheduleEvent: !!rescheduleUid,
isFirstRecurringEvent: true,
isFirstRecurringEvent: req.body.allRecurringDates ? req.body.isFirstRecurringSlot : true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
isFirstRecurringEvent: req.body.allRecurringDates ? req.body.isFirstRecurringSlot : true,
isFirstRecurringEvent: req.body.allRecurringDates ? req.body.isFirstRecurringSlot : false,

@@ -141,7 +141,7 @@ export const scheduleWorkflowReminders = async (args: ScheduleWorkflowRemindersA
calendarEvent: evt,
isNotConfirmed = false,
isRescheduleEvent = false,
isFirstRecurringEvent = false,
isFirstRecurringEvent = true,
Copy link
Member Author

Choose a reason for hiding this comment

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

@Udit-takkar isFirstRecurringEvent should default to true if it is normal event and not recurring. Why? The first recurring event is handled the same as a normal event

@CarinaWolli
Copy link
Member Author

CleanShot 2024-05-21 at 11 11 23

Hey @CarinaWolli i just tested this and it doesnt seem to work as i am still getting all the emails per scheduled event - am i misunderstanding something

@sean-brydon is that a workflow email? looks like the broken integration email

@sean-brydon
Copy link
Member

CleanShot 2024-05-21 at 11 11 23
Hey @CarinaWolli i just tested this and it doesnt seem to work as i am still getting all the emails per scheduled event - am i misunderstanding something

@sean-brydon is that a workflow email? looks like the broken integration email

Sorry for the late reply on this - slipped my inbox.

I've just tested this again and im seeing the same issue :/ I logged out and send email is still being called N times for the number of recuring events so im not sure its something to do with the email integration 🤔 Will have a dig around

@CarinaWolli
Copy link
Member Author

CleanShot 2024-05-21 at 11 11 23
Hey @CarinaWolli i just tested this and it doesnt seem to work as i am still getting all the emails per scheduled event - am i misunderstanding something

@sean-brydon is that a workflow email? looks like the broken integration email

Sorry for the late reply on this - slipped my inbox.

I've just tested this again and im seeing the same issue :/ I logged out and send email is still being called N times for the number of recuring events so im not sure its something to do with the email integration 🤔 Will have a dig around

That's weird. Could you provide the steps how you are testing it?

That's how I test it:

  1. Create a user event type and enable recurring events
  2. Create workflow with 'when new event is booked' trigger and 'email to attendee' action
  3. Set event type active on that workflow
  4. Book the event type with several recurrences
  5. I have sendgrid for workflow emails set up, so I check if I received ONE workflow email only

@sean-brydon
Copy link
Member

CleanShot 2024-05-21 at 11 11 23
Hey @CarinaWolli i just tested this and it doesnt seem to work as i am still getting all the emails per scheduled event - am i misunderstanding something

@sean-brydon is that a workflow email? looks like the broken integration email

Sorry for the late reply on this - slipped my inbox.
I've just tested this again and im seeing the same issue :/ I logged out and send email is still being called N times for the number of recuring events so im not sure its something to do with the email integration 🤔 Will have a dig around

That's weird. Could you provide the steps how you are testing it?

That's how I test it:

  1. Create a user event type and enable recurring events
  2. Create workflow with 'when new event is booked' trigger and 'email to attendee' action
  3. Set event type active on that workflow
  4. Book the event type with several recurrences
  5. I have sendgrid for workflow emails set up, so I check if I received ONE workflow email only

Well - it turns out there was an issue with my mail setup - had four containers running somehow and they were all receiving emails.

Works fine now :D Sorry!

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.

LGTM

@CarinaWolli CarinaWolli added this pull request to the merge queue Jun 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 5, 2024
@CarinaWolli CarinaWolli added this pull request to the merge queue Jun 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 5, 2024
@sean-brydon sean-brydon added this pull request to the merge queue Jun 6, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 6, 2024
@keithwillcode keithwillcode added this pull request to the merge queue Jun 6, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 6, 2024
@PeerRich PeerRich added this pull request to the merge queue Jun 6, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 6, 2024
@CarinaWolli CarinaWolli added this pull request to the merge queue Jun 6, 2024
Merged via the queue into main with commit a574e5e Jun 6, 2024
24 checks passed
@CarinaWolli CarinaWolli deleted the fix/sms-recurring-event branch June 6, 2024 18:50
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 High priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants