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: creating workflow reminders for existing bookings when new step is added #12878

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

CarinaWolli
Copy link
Member

What does this PR do?

This PR fixes the error in workflows/update.handler.ts when adding a new step to a workflow to and workflow that has active event types.

Error:
Screenshot 2023-12-19 at 1 54 34 PM

Type of change

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

How should this be tested?

  • Create new workflow with before event trigger
  • In dropdown, set active on an event type
  • add a new step, 'send email to host'
  • save workflow

Copy link

vercel bot commented Dec 19, 2023

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 Dec 19, 2023 7:01pm
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2023 7:01pm
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2023 7:01pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 7:01pm
cal-demo ⬜️ Ignored (Inspect) Dec 19, 2023 7:01pm
ui ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2023 7:01pm

Copy link
Contributor

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

@@ -262,7 +262,7 @@ export const updateHandler = async ({ ctx, input }: UpdateOptions) => {
},
});

const promiseSteps = steps.map(async (step) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

steps includes new steps that are not yet created in the DB. That's why it was throwing the foreign key error

if (addedSteps) {
const eventTypesToCreateReminders = activeOn.filter(
(activeEventType) => activeEventType && !newEventTypes.includes(activeEventType)
Copy link
Member Author

Choose a reason for hiding this comment

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

As we don't schedule email reminders for new event types anymore on the new steps, we want to schedule them here, so no need to filter them out

Copy link
Contributor

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

@CarinaWolli CarinaWolli enabled auto-merge (squash) December 19, 2023 19:04
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

@CarinaWolli CarinaWolli merged commit 24264c3 into main Dec 20, 2023
17 checks passed
@CarinaWolli CarinaWolli deleted the fix/update-workflown-new-step branch December 20, 2023 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants