Skip to content

Conversation

@volnei
Copy link
Contributor

@volnei volnei commented Jan 19, 2026

What does this PR do?


Summary by cubic

Adds error tracking and backoff for calendar subscriptions to reduce repeated failures and unnecessary retries. Subscriptions now pause for 24 hours after an error and stop after 3 failures.

  • New Features

    • Track subscription errors with syncSubscribedErrorAt and syncSubscribedErrorCount on SelectedCalendar.
    • CalendarSubscriptionService resets these on success, increments on failure, and stops at 3 errors.
    • SelectedCalendarRepository skips calendars with a recent error (last 24h) and those with 3+ errors.
  • Migration

    • Run Prisma migrate to add the new columns on SelectedCalendar.

Written for commit b345ad6. Summary will update on new commits.

@github-actions github-actions bot added the ❗️ migrations contains migration files label Jan 19, 2026
@volnei volnei marked this pull request as ready for review January 19, 2026 19:16
@volnei volnei requested a review from a team as a code owner January 19, 2026 19:16
@graphite-app graphite-app bot added foundation core area: core, team members only labels Jan 19, 2026
@volnei volnei enabled auto-merge (squash) January 19, 2026 19:18
@volnei volnei changed the title chore: Add calendar subscription error better management chore: Add calendar subscription error better management (backoff) Jan 19, 2026
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 12 files

@github-actions
Copy link
Contributor

E2E results are ready!

Comment on lines +42 to +48
const retryableWindowFilter: Prisma.SelectedCalendarWhereInput = {
OR: [{ syncSubscribedErrorAt: null }, { syncSubscribedErrorAt: { lt: oneDayAgo } }],
};

const retryableErrorCountFilter: Prisma.SelectedCalendarWhereInput = {
syncSubscribedErrorCount: { lt: MAX_SUBSCRIBE_ERRORS },
};
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like it will not be an issue, but just to double check we don't need partial indexes for this new filters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah.. this is just a 100 rows query filtered by users (already indexed) so there's no issue 🙏🏼

@volnei volnei requested a review from ThyMinimalDev January 20, 2026 13:03
@volnei volnei merged commit 5ddb4dc into main Jan 20, 2026
98 of 101 checks passed
@volnei volnei deleted the chore/subscribe-calendar-better-error-handling branch January 20, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only foundation ❗️ migrations contains migration files ready-for-e2e size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants