Skip to content

Rescheduling or cancelling after a destination change acts on the wrong calendar provider #58

Closed

Description

@distronode-com

Before submitting

  • I've searched existing issues and this isn't a duplicate.
  • This is a reproducible bug in Calnode, not a configuration/setup question or a feature request.

What's the bug?

Rescheduling or cancelling a booking acts on the host's current destination provider, not the provider that holds the event. Service.UpdateEvent and Service.CancelEvent (internal/calendar/calendar.go) both call providerForDestination. Once a host with Google and Microsoft connected moves their destination from one to the other, every older booking's event id is handed to a provider that never issued it:

  • Google → Microsoft, cancel: DELETE /me/events/<Google event id> on Graph. A 404 is treated as "already gone" (microsoft/events.go), so the booking cancels and the event silently stays on the Google calendar. Any other status is an error the reconciler retries every sweep.
  • Microsoft → Google: gcal deletes or patches calendars/<stored Microsoft calendar id>/events/<Graph id>. Only 410 counts as already gone, so this errors and the reconciler retries it for as long as the booking row exists.
  • Reschedule has the same shape: the event stays at its old time and needs_sync never clears.

booking_hosts stores external_event_id and external_calendar_id but not which provider wrote them, so the router has nothing better to go on. CalDAV is the one provider whose id identifies itself (it is the event URL); #56 routes those by id. Google and Microsoft ids are opaque, so they need the provider recorded when the event is created.

Steps to reproduce

  1. Connect Google and Microsoft calendars for one host; make Google the destination.
  2. Book a meeting (the event is created on Google).
  3. Make Microsoft the destination.
  4. Cancel the booking. Following the code path, the cancel goes to the Microsoft client with the Google event id, and the Google event is left in place.

Calnode version / commit

main at 8c3cb5d.

How are you running Calnode?

Found by reading the code on main; I have not run this sequence against live Google and Microsoft accounts.

Logs, screenshots, or anything else

Fix direction: record the provider on booking_hosts next to external_calendar_id at create time and route update/cancel by it, falling back to the destination only for rows written before the column existed.

Activity

  1. pullfrog commented on Sep 17, 2026

    @pullfrog
    Contributor
  2. shockalotti commented on Sep 17, 2026

    @shockalotti
    Contributor

    Confirmed on the code path - you're right, and the Google-to-Microsoft silent orphan is the nasty one. Stamping the provider at create time with destination fallback for old rows sounds right. Taking #59 first, then this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions