Skip to content

fix(calendar): recover from fetch errors promptly, track errors per calendar - #4342

Open
MikeBishop wants to merge 1 commit into
MagicMirrorOrg:developfrom
MikeBishop:claude/calendar-connection-errors-e062fc
Open

MikeBishop wants to merge 1 commit into
MagicMirrorOrg:developfrom
MikeBishop:claude/calendar-connection-errors-e062fc

Conversation

@MikeBishop

Copy link
Copy Markdown
Contributor

Sporadic "No internet connection." messages could blank the calendar after a single transient network error, and the message could linger after the connection came back.

  • Track fetch errors per calendar URL instead of one error per module, so one failing calendar no longer hides the others once they have recovered.
  • Clear the error and redraw as soon as a calendar fetches successfully again, even if the events checksum is unchanged. Previously the redraw was skipped, so the error stayed until the next once-a-minute self update.
  • Include url in the CALENDAR_ERROR socket notification so the front end can attribute errors to a calendar.
  • Add an opt-in keepEventsOnError option (default false, so current behavior is unchanged). When true, the last known events stay visible after a failed fetch, and the error is only shown if there are no events to display.
  • Add unit tests for recovery with an unchanged checksum, multiple failing calendars, the default behavior, and keepEventsOnError.

No related issue.

🤖 Generated with Claude Code

…alendar

A single transient network error replaced the whole calendar with
"No internet connection", and the message could linger after recovery
because an unchanged events checksum skipped the redraw.

- Track errors per calendar URL; clear and redraw on a successful fetch
- Include url in CALENDAR_ERROR notifications
- Add keepEventsOnError option (default false) to keep showing the last
  known events when a later fetch fails

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

Speaks something against enabling this behavior permanently and omit the new opt-in option?

@MikeBishop

Copy link
Copy Markdown
Contributor Author

Considered that, but it means that the error isn't visible from the screen unless all calendars have failed from the start. Some people might prefer to see an error so they can fix it. Some visual cue that the shown events are stale might be an alternative.

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

Good point. What do you think of using a small grace period instead of a new config option - e.g. keeping existing events for the first 2 or 3 consecutive fetch failures and only showing the error if it persists? That would handle transient glitches by default while still surfacing permanent errors.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants