fix: stop reporting cancelled calendar loads as errors #5

Merged
oss merged 1 commit from fix/screenshot-issue-investigation into main 2026-10-19 10:51:48 +02:00
Owner

The header showed "Couldn't load Personio calendar: cancelled" even though the Personio events loaded correctly.

Cause

  • .task(id: vm.weekAnchor) restarted the calendar reload whenever weekAnchor changed. Clicking Today sets it to Date(), so the reload restarted even when the visible week stayed the same.
  • When the task was cancelled, URLSession threw URLError.cancelled. The week was unchanged, so the catch block's isVisibleWeek check passed and the cancellation was shown as an error.
  • Only the Google load cleared calendarNote, so the Personio error stayed after the replacement load succeeded.

Fix

  • Key the task on vm.weekStart, so it restarts only when the week changes.
  • Ignore CancellationError / URLError.cancelled in loadCalendarEvents and loadPersonioEvents.
  • Keep Personio errors in a separate personioNote, cleared at the start of each Personio load and in clearPersonioState().

Verification

Debug build succeeds. No automated tests exist in this repo.

🤖 Generated with Claude Code

The header showed "Couldn't load Personio calendar: cancelled" even though the Personio events loaded correctly. ## Cause - `.task(id: vm.weekAnchor)` restarted the calendar reload whenever `weekAnchor` changed. Clicking **Today** sets it to `Date()`, so the reload restarted even when the visible week stayed the same. - When the task was cancelled, URLSession threw `URLError.cancelled`. The week was unchanged, so the catch block's `isVisibleWeek` check passed and the cancellation was shown as an error. - Only the Google load cleared `calendarNote`, so the Personio error stayed after the replacement load succeeded. ## Fix - Key the task on `vm.weekStart`, so it restarts only when the week changes. - Ignore `CancellationError` / `URLError.cancelled` in `loadCalendarEvents` and `loadPersonioEvents`. - Keep Personio errors in a separate `personioNote`, cleared at the start of each Personio load and in `clearPersonioState()`. ## Verification Debug build succeeds. No automated tests exist in this repo. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Reload calendars only when the visible week changes, ignore cancellation in
the Google and Personio loads, and keep the Personio error in its own note so
a later successful load clears it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oss merged commit bc4122076a into main 2026-10-19 10:51:48 +02:00
oss deleted branch fix/screenshot-issue-investigation 2026-10-19 10:51:48 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
oss/TEMPO-UI!5
No description provided.