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
feat: Delete/Create WebhookScheduledTriggers for existing bookings #14121
feat: Delete/Create WebhookScheduledTriggers for existing bookings #14121
Conversation
@v0ltZzie is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (03/17/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add community label" took an action on this PR • (03/17/24)1 label was added to this PR based on Keith Williams's automation. |
📦 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.
Great start already, but we also need to handle account wide webhooks from http://localhost:3000/settings/developer/webhooks. Right now this only takes care of event type specific webhooks.
I have a PR open that adds a relationship between WebhooksScheduledTriggers
and Webhook
, which probably would make it easier to find the jobs we need to cancel #14188
|
||
if ( | ||
removedEventTriggers.length > 0 && | ||
removedEventTriggers.some((trigger) => SCHEDULING_TRIGGER.includes(trigger)) |
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.
removedEventTriggers.some((trigger) => SCHEDULING_TRIGGER.includes(trigger))
Why do we need that?
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.
Forgot to remove it from here.
(trigger) => !updatedEventTriggers.includes(trigger) && SCHEDULING_TRIGGER.includes(trigger) | ||
); | ||
const currentTime = new Date(); | ||
const bookings = await prisma.booking.findMany({ |
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.
let's early return before that if there are no added or removed triggers
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.
Will do.
); | ||
const currentTime = new Date(); | ||
const bookings = await prisma.booking.findMany({ | ||
where: { |
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.
can already query for only ACCEPTED bookings here?
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.
Yeah right, slipped my mind 😅
Will make other changes till your pr is merged. |
@CarinaWolli Now this works for account wide webhooks too. |
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.
Looks good, tested and works 🙌🏻 Thank you 🙏
What does this PR do?
Fixes #14103
Screen.Recording.2024-03-17.at.4.04.39.PM.mov
Type of change
Mandatory Tasks