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

[CAL-3752] Unreliable Triggering and Payload Inconsistencies in Calcom Webhooks #15078

Open
hussamkhatib opened this issue May 16, 2024 · 12 comments · May be fixed by #15036
Open

[CAL-3752] Unreliable Triggering and Payload Inconsistencies in Calcom Webhooks #15078

hussamkhatib opened this issue May 16, 2024 · 12 comments · May be fixed by #15036
Labels
🐛 bug Something isn't working High priority Created by Linear-GitHub Sync Urgent Created by Linear-GitHub Sync webhooks area: webhooks, callback, webhook payload
Milestone

Comments

@hussamkhatib
Copy link
Contributor

hussamkhatib commented May 16, 2024

Issue Summary

My team has been facing issues with calcom webhooks one after the other. The triggering of the webhooks isn't reliable, so is the payload of the triggers

MEETING_STARTED and MEETING_ENDED

  • Triggers at incorrect time (For eg both meeting start and end was triggered at 4:54:13)
Screenshot 2024-05-16 at 7 21 31 PM
  • Sometimes it does not trigger at all. (It might be the case when the booking is booked very close to the current time)

  • Irregular Request body (main issue)

    • 1st variant
 {
       triggerEvent: 'MEETING_STARTED',
       id: 2030837,
       uid: 'b7bUM9yNBpURfEtRy5fSYM',
       idempotencyKey: 'c86af8f1-2d63-5a04-ad8d-d209fc691a56',
       userId: 64419,
       userPrimaryEmail: 'hussamxxxxxx@gmail.com',
       eventTypeId: 788720,
       title: 'test between Hussam Khatib and Hussam',
       description: '',
       customInputs: {},
       responses: {
         name: 'Hussam',
         email: 'hussam@xxxx.com',
         guests: [],
         location: [Object]
       },
       startTime: '2024-05-14T18:49:02.000Z',
       endTime: '2024-05-14T18:50:02.000Z',
       location: 'integrations:daily',
       createdAt: '2024-05-14T18:48:07.759Z',
       updatedAt: null,
       status: 'ACCEPTED',
       paid: false,
       destinationCalendarId: null,
       cancellationReason: null,
       rejectionReason: null,
       dynamicEventSlugRef: null,
       dynamicGroupSlugRef: null,
       rescheduled: null,
       fromReschedule: 'hR5Lzz7BmE1s1erY6Zd5at',
       recurringEventId: null,
       smsReminderNumber: null,
       scheduledJobs: [],
       metadata: {
         videoCallUrl: 'https://app.cal.com/video/xxxxxxxx'
       },
       isRecorded: false,
       iCalUID: 'hR5Lzz7BmE1s1erY6Zd5at@Cal.com',
       iCalSequence: 0,
       rating: null,
       ratingFeedback: null,
       noShowHost: null,
       user: {
         email: 'hussamxxxxx@gmail.com',
         name: 'Hussam Khatib',
         timeZone: 'Asia/Calcutta',
         username: 'hussamkhatib'
       },
       attendees: [ [Object] ],
       payment: [],
       references: [],
       appsStatus: [ [Object] ]
     }
   }

  • I had opened an issue for it, we had decided to move ahead with handling these 2 triggerEvent differently only to find out that something attendees is not defined.
  • There's no organizer Object.

RECORDING_READY

  • Does not trigger at all. (Note: It's been only few days since we are facing this Issue, it used to work fine a few days back)
  • Also has a different payload.
export interface RECORDING_READY {
  type: string
  title: string
  startTime: string
  endTime: string
  organizer: Organizer
  attendees?: AttendeesEntity[] | null
  uid: string
  downloadLink: string
}

Steps to Reproduce

Follow the steps mentioned in the docs to setup webhooks and print logs of the request body with timestamps
Use the link provided in the meeting(CAL video) and record the meeting

Actual Results

  • You will find no logs printed for RECORDING_READY webhook
  • You should find a different payload for MEETING_STARTED and MEETING_ENDED than what is mentioned in the docs.

Evidence

  • The snippets above are Response of actual booking made app.cal.com

CAL-3752

Copy link

dosubot bot commented May 16, 2024

Hey @hussamkhatib, great to see you back! 😀 We definitely remember working through some challenges together. I'm diving into the details of what you've shared and will circle back with a comprehensive response soon.

@dosubot dosubot bot added webhooks area: webhooks, callback, webhook payload 🐛 bug Something isn't working labels May 16, 2024
@l0g1x
Copy link

l0g1x commented May 16, 2024

Additionally, the automated emails the calcom would send to all attendees and the organizer once the recording is completed, no longer get sent

Copy link

dosubot bot commented May 16, 2024

To address the issues you're encountering with Cal.com webhooks, let's dive into specifics:

  1. MEETING_STARTED and MEETING_ENDED Events Timing and Triggering:

    • The Cal.com system schedules triggers for MEETING_STARTED and MEETING_ENDED events based on the booking's start and end times, ensuring that events are triggered as expected, even for bookings made close to the current time. This process is managed through the scheduleTrigger function, which prepares and schedules the event triggers in the database.
  2. Payload Inconsistencies:

  3. RECORDING_READY Event and Automated Emails:

    • The RECORDING_READY event and the process for sending automated emails upon recording completion involve initializing classes with event and attendee details to prepare email payloads. Recent changes, such as the addition of RECORDING_READY to the WebhookTriggerEvents enum, could impact the triggering of this event and the email sending process. It's crucial to ensure that the application's logic is updated to handle this new event type properly.

For further assistance, please share more details about your Cal.com codebase version, the steps you're following to set up and trigger the webhooks, and any specific error messages or logs. This information will be vital for diagnosing and resolving the issues more effectively.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@CarinaWolli
Copy link
Member

Triggers at incorrect time (For eg both meeting start and end was triggered at 4:54:13)

Our meeting ended and started trigger doesn't trigger at the exact time as we have a corn job running every 5 minute that then triggers all webhooks. Your meeting starts at 4:50 and ends at 4:51, that's why both were triggered at the same time at 4:54

Sometimes it does not trigger at all. (It might be the case when the booking is booked very close to the current time)

That can happen when the trigger time is closer than 5 minutes to the current time. Also there was a current fix for another issue related to that #14864, however old bookings that were created before the fix can still cause the issue

Irregular Request body (main issue)

We are currently working on fixing the request body of the meeting started and meeting ended trigger #15036

RECORDING_READY
Does not trigger at all. (Note: It's been only few days since we are facing this Issue, it used to work fine a few days back)

Tagging @Udit-takkar for this one


@hussamkhatib Let me know if I didn't address everything and if you have any questions to that

@PeerRich PeerRich added High priority Created by Linear-GitHub Sync Urgent Created by Linear-GitHub Sync labels May 17, 2024
@PeerRich PeerRich added this to the v4.2 milestone May 17, 2024
@PeerRich PeerRich changed the title Unreliable Triggering and Payload Inconsistencies in Calcom Webhooks [CAL-3752] Unreliable Triggering and Payload Inconsistencies in Calcom Webhooks May 17, 2024
@PeerRich
Copy link
Member

added highest priority

@hussamkhatib
Copy link
Contributor Author

Thanks @CarinaWolli, that’s helpful!

@Udit-takkar
Copy link
Contributor

RECORDING_READY
Does not trigger at all. (Note: It's been only few days since we are facing this Issue, it used to work fine a few days back)

This was fixed yesterday.

@l0g1x
Copy link

l0g1x commented May 17, 2024 via email

@Udit-takkar
Copy link
Contributor

@l0g1x No PR was required for this. I had to make a POST request to restart subscribing to recording ready event.

@hussamkhatib
Copy link
Contributor Author

RECORDING_READY
Does not trigger at all. (Note: It's been only few days since we are facing this Issue, it used to work fine a few days back)

This was fixed yesterday.

Thanks @Udit-takkar, It works now

@hussamkhatib
Copy link
Contributor Author

@Udit-takkar We had a Meeting an hour back, the recording ready din't trigger again.

@Udit-takkar
Copy link
Contributor

@Udit-takkar We had a Meeting an hour back, the recording ready din't trigger again.

Restarted this again. investigating why it's failing sometimes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working High priority Created by Linear-GitHub Sync Urgent Created by Linear-GitHub Sync webhooks area: webhooks, callback, webhook payload
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants