Skip to content

fix: write through outbound calendar updates to the local event cache - #95

Merged
wahve3 merged 1 commit into
Tymeslot:mainfrom
PixelJonas:fix/reschedule-cache-write-through-upstream
Sep 10, 2026
Merged

fix: write through outbound calendar updates to the local event cache#95
wahve3 merged 1 commit into
Tymeslot:mainfrom
PixelJonas:fix/reschedule-cache-write-through-upstream

Conversation

@PixelJonas

Copy link
Copy Markdown
Contributor

What does this change?

Rescheduling a meeting pushes the new time to the external calendar provider (CalDAV/Google/Outlook) synchronously — availability checks are always correct — but this outbound path never updated the local provider_calendar_event cache table or broadcast a cache-update event, unlike the inbound sync path, which does both.

Since the calendar-view dedup logic prefers the cache row over the live Meeting whenever the two are linked, the calendar grid kept showing the pre-reschedule time until the next inbound sync cycle happened to reconcile it (15-90 minutes later, whenever that provider's poll/webhook next fired).

CalendarEventSync.update/2 now, after a successful outbound push:

  • looks up the linked cache row by provider_event_id for OAuth providers, falling back to uid for CalDAV — mirroring ExternalCalendarChanges.find_linked_meeting/3's existing lookup order
  • writes through the pushed start/end time and content fields via a new narrow ProviderCalendarEventQueries.update_after_outbound_push/2
  • broadcasts the change the same way inbound sync already does

A failed outbound push never touches the cache, and a missing cache row (e.g. the first outbound push before any inbound sync has run yet) is a no-op.

Covered by 4 new tests: CalDAV write-through, OAuth provider_event_id-keyed write-through, no-op when there's no cache row, and no write on push failure.

Checklist

  • Commits are signed off with git commit -s (required — CI enforces the DCO; see CONTRIBUTING)
  • Tests pass locally (mix test), if relevant

Rescheduling a meeting pushed the new time to the external calendar
provider (CalDAV/Google/Outlook) but never updated the local
provider_calendar_event cache row or broadcast a cache-update event —
unlike the inbound sync path, which does both. Since the calendar-view
dedup logic prefers the cache row over the live Meeting whenever the
two are linked, the grid kept showing the pre-reschedule time until the
next inbound sync cycle happened to reconcile it (15-90 minutes later).

CalendarEventSync.update/2 now looks up the linked cache row after a
successful outbound push (by provider_event_id for OAuth providers,
falling back to uid for CalDAV, mirroring
ExternalCalendarChanges.find_linked_meeting/3's existing lookup order),
writes through the pushed start/end time and content fields via a new
narrow ProviderCalendarEventQueries.update_after_outbound_push/2, and
broadcasts the change the same way inbound sync does. A failed outbound
push never touches the cache, and a missing cache row (first outbound
push before any inbound sync has run) is a no-op.

Assisted-by: Claude Code
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: PixelJonas <5434875+PixelJonas@users.noreply.github.com>
@wahve3
wahve3 merged commit c513357 into Tymeslot:main Sep 10, 2026
4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants