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

chore: better logging for failed webhooks #14825

Conversation

Shpadoinkle
Copy link
Contributor

What does this PR do?

When a webhook fails to send it's payload. Current logs aren't helpful for finding out which booking failed.

Fixes # (issue)
#13279

Requirement/Documentation

  • If there is a requirement document, please, share it here.
  • If there is a UI/UX design document, please, share it here.

Type of change

Chore

How should this be tested?

force a webhook to fail.
Logs should shed more light on the Booking it was for

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

@CLAassistant
Copy link

CLAassistant commented May 1, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

vercel bot commented May 1, 2024

@Shpadoinkle is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot requested a review from a team May 1, 2024 03:48
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label May 1, 2024
Copy link
Contributor

github-actions bot commented May 1, 2024

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

@dosubot dosubot bot added bookings area: bookings, availability, timezones, double booking webhooks area: webhooks, callback, webhook payload labels May 1, 2024
Copy link

graphite-app bot commented May 1, 2024

Graphite Automations

"Add community label" took an action on this PR • (05/01/24)

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

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

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

Copy link
Contributor

github-actions bot commented May 1, 2024

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

Copy link
Member

@alishaz-polymath alishaz-polymath left a comment

Choose a reason for hiding this comment

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

LGTM 🚀
Thank you for the contribution.

Comment on lines 83 to 86
console.error(
`Error executing webhook for event: ${eventTrigger}, URL: ${webhook.subscriberUrl}, bookingId: ${evt.bookingId}, bookingUid: ${evt.uid}`,
e
);
Copy link
Contributor

Choose a reason for hiding this comment

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

@Shpadoinkle can you please replace this with logger?

Copy link
Contributor

Choose a reason for hiding this comment

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

you can import logger from "@calcom/lib/logger";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@keithwillcode keithwillcode left a comment

Choose a reason for hiding this comment

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

Requesting changes so this is blocked from merge until @Udit-takkar's requested change is implemented

@Shpadoinkle Shpadoinkle force-pushed the feat/better-logging-for-failed-webhooks branch from 70c1037 to 3792f31 Compare May 6, 2024 22:57
@Shpadoinkle Shpadoinkle force-pushed the feat/better-logging-for-failed-webhooks branch from 3792f31 to cab9982 Compare May 8, 2024 04:28
@keithwillcode keithwillcode added this to the v4.1 milestone May 8, 2024
@Shpadoinkle Shpadoinkle force-pushed the feat/better-logging-for-failed-webhooks branch from cab9982 to a6cbdb8 Compare May 13, 2024 00:39
@Shpadoinkle Shpadoinkle force-pushed the feat/better-logging-for-failed-webhooks branch from a6cbdb8 to f6d3b9e Compare May 14, 2024 22:52
@Shpadoinkle
Copy link
Contributor Author

@keithwillcode @Udit-takkar anything else you need for this pr?

@keithwillcode keithwillcode modified the milestones: v4.1, v4.2 May 15, 2024
@Shpadoinkle Shpadoinkle force-pushed the feat/better-logging-for-failed-webhooks branch from f6d3b9e to 9ee430d Compare May 15, 2024 22:47
@Shpadoinkle
Copy link
Contributor Author

@alishaz-polymath can you check if there is anything else wanted on this?

Copy link
Member

@alishaz-polymath alishaz-polymath left a comment

Choose a reason for hiding this comment

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

LGTM
@Udit-takkar what's do you think?

@PeerRich PeerRich enabled auto-merge (squash) May 16, 2024 10:00
auto-merge was automatically disabled May 20, 2024 11:52

Base branch was modified

@alishaz-polymath alishaz-polymath enabled auto-merge (squash) May 22, 2024 08:46
@alishaz-polymath alishaz-polymath merged commit aca2b29 into calcom:main May 22, 2024
34 of 41 checks passed
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 community Created by Linear-GitHub Sync webhooks area: webhooks, callback, webhook payload
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants