Skip to content

Conversation

@ThyMinimalDev
Copy link
Contributor

@ThyMinimalDev ThyMinimalDev commented Jan 27, 2026

What does this PR do?

Fixes an unhandled promise rejection in the Google Calendar service that could crash the API when hitting Google Calendar quota limits.

In the updateEvent method, the calendar.events.patch call (used to update the event description with the hangout link) was not awaited. This meant if the patch request failed (e.g., due to quota exceeded errors), the promise rejection would occur after the function returned, bypassing the try/catch block and causing an unhandled rejection.

Error that was occurring:

unhandledRejection: Quota exceeded for quota metric 'Queries' and limit 'Queries per minute' of service 'calendar-json.googleapis.com'

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - no documentation changes needed.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works. N/A - existing error handling tests cover this; the fix ensures errors are now caught by the existing try/catch.

How should this be tested?

  1. The fix ensures that any errors from the calendar.events.patch call are now properly caught by the surrounding try/catch block
  2. To reproduce the original issue, you would need to hit Google Calendar API quota limits during an event update with a Google Meet link
  3. With this fix, quota errors will be caught and logged rather than causing an unhandled rejection

Human Review Checklist

  • Verify the existing try/catch block (line 434-440) will properly catch errors from the now-awaited patch call
  • Consider if waiting for the patch has any unintended side effects (it shouldn't - this is the correct behavior)

Link to Devin run: https://app.devin.ai/sessions/3bae43ad0f0a4680899fe9b4e0908aec
Requested by: @ThyMinimalDev

Co-Authored-By: morgan@cal.com <morgan@cal.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@ThyMinimalDev ThyMinimalDev marked this pull request as ready for review January 27, 2026 20:18
@ThyMinimalDev ThyMinimalDev requested a review from a team as a code owner January 27, 2026 20:18
@graphite-app graphite-app bot added foundation core area: core, team members only labels Jan 27, 2026
Copy link
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

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

Yep, let's merge 👍

@ThyMinimalDev ThyMinimalDev enabled auto-merge (squash) January 27, 2026 20:20
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@ThyMinimalDev ThyMinimalDev merged commit 23067cd into main Jan 27, 2026
90 of 91 checks passed
@ThyMinimalDev ThyMinimalDev deleted the devin/1769544881-fix-unawaited-gcal-patch branch January 27, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants