Skip to content

fix(calendar): add error handling for outbound Google Calendar sync#10696

Merged
ArtyomSavchenko merged 1 commit intohcengineering:developfrom
cyphercodes:fix/calendar-outbound-sync-error-handling
Mar 27, 2026
Merged

fix(calendar): add error handling for outbound Google Calendar sync#10696
ArtyomSavchenko merged 1 commit intohcengineering:developfrom
cyphercodes:fix/calendar-outbound-sync-error-handling

Conversation

@cyphercodes
Copy link
Copy Markdown
Contributor

@cyphercodes cyphercodes commented Mar 27, 2026

Summary

Add proper error handling to prevent silent failures when syncing events to Google Calendar.

Problem

As described in #10535, outbound sync from Huly to Google Calendar was failing silently due to:

  1. Unhandled promise rejections in the webhook handler
  2. Missing try/catch blocks around Google API calls
  3. Empty catch blocks that swallowed errors

Changes

  • main.ts: Add .catch() handler to log sync failures with event context
  • outcomingClient.ts: Add try/catch in create() method to log Google API insert errors with calendarId, eventId, and error details
  • outcomingClient.ts: Improve error handling in remove() method to properly log get/delete errors

Testing

These changes ensure that:

  • Sync failures are properly logged with context (eventId, workspace, error message)
  • Google API errors include the HTTP status code for easier debugging
  • Errors are no longer silently swallowed

Fixes #10535

Add proper error handling to prevent silent failures when syncing events
to Google Calendar:

- Add .catch() handler in main.ts webhook to log sync failures
- Add try/catch in create() method to log Google API insert errors
- Improve error handling in remove() method to log get/delete errors

Fixes hcengineering#10535
@huly-github-staging
Copy link
Copy Markdown

Connected to Huly®: UBERF-16111

@ArtyomSavchenko
Copy link
Copy Markdown
Member

ArtyomSavchenko commented Mar 27, 2026

@cyphercodes Could you please change target branch to develop?
The develop branch is used for development and is the default branch for new contributions.

@cyphercodes cyphercodes changed the base branch from main to develop March 27, 2026 04:46
@cyphercodes
Copy link
Copy Markdown
Contributor Author

@ArtyomSavchenko Done! Changed target branch to develop. Thanks for the review.

@ArtyomSavchenko ArtyomSavchenko merged commit 82f1647 into hcengineering:develop Mar 27, 2026
1 check passed
@ArtyomSavchenko
Copy link
Copy Markdown
Member

@cyphercodes The changes look good to me.
Thank you for the contribution.

haiodo pushed a commit to haiodo/foundation that referenced this pull request Mar 28, 2026
…cengineering#10696)

Add proper error handling to prevent silent failures when syncing events
to Google Calendar:

- Add .catch() handler in main.ts webhook to log sync failures
- Add try/catch in create() method to log Google API insert errors
- Improve error handling in remove() method to log get/delete errors

Fixes hcengineering#10535
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Huly to Google Calendar Outbound Sync Fails Silently (Unhandled Promise Rejections)

2 participants