fix: write through outbound calendar updates to the local event cache - #95
Merged
wahve3 merged 1 commit intoSep 10, 2026
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_eventcache 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
Meetingwhenever 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/2now, after a successful outbound push:provider_event_idfor OAuth providers, falling back touidfor CalDAV — mirroringExternalCalendarChanges.find_linked_meeting/3's existing lookup orderProviderCalendarEventQueries.update_after_outbound_push/2A 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
git commit -s(required — CI enforces the DCO; see CONTRIBUTING)mix test), if relevant