-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
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) => { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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](https://private-user-images.githubusercontent.com/30310907/291686213-6b9129ac-7506-43c9-b41c-95d62d9b9e69.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MjMzMDAsIm5iZiI6MTczOTkyMzAwMCwicGF0aCI6Ii8zMDMxMDkwNy8yOTE2ODYyMTMtNmI5MTI5YWMtNzUwNi00M2M5LWI0MWMtOTVkNjJkOWI5ZTY5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDIzNTY0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM0OTZiMWRjY2QxOTVlZTg4OTQ3MzcwZjEyYjdmMzNkMjFjMmE1MjI0YWMzOGVhNTBmZWUzNjVjMWJlZjYyMDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1uaDgZQ7Tt9VfcDLlnHTvaqhROA91S4DJJaVm3NglJA)
Type of change
How should this be tested?