Skip to content

fix(calendar): hash calendar IDs in the events cache key (1.2.12) - #613

Merged
ChuckBuilds merged 1 commit into
mainfrom
fix/calendar-cache-key-length
Oct 4, 2026
Merged

ChuckBuilds merged 1 commit into
mainfrom
fix/calendar-cache-key-length

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Problem

On hdpi the calendar logs this warning on every update:

WARNING - src.cache_manager - Could not create temp file in /var/cache/ledmatrix, using direct write for calendar_events_<email>_en.usa#holiday@group.v.calendar.google.com_family...@group.calendar.google.com_ncaaf_-m-07kbp5_%47eorgia+%42ulldogs+football#sports@...
WARNING - src.cache_manager - Direct write failed ...
WARNING - src.cache_manager - Could not write cache ...

The events cache key was calendar_events_ + every selected calendar ID joined with _, and the cache manager uses the key as the filename. With five calendars, including Google's long holiday and sports calendar IDs, the name is longer than the 255-byte filename limit. Every write fails, so the events are never cached and the plugin asks Google for them again on every update.

Fix

The key is now calendar_events_ + the first 16 hex characters of a sha256 of the sorted calendar IDs (manager.py). It's still unique per set of calendars and stays the same length however many calendars are selected.

Version 1.2.11 → 1.2.12 (patch), with a new versions[0] entry. plugins.json was regenerated with update_registry.py. Core floor is unchanged.

Testing

  • All 3 calendar tests pass: test_display_does_not_blank_the_panel, test_no_interactive_auth, test_without_google_libraries.
  • check_version_bump.py --base main calendar: PASS (1.2.11 → 1.2.12).
  • update_registry.py --check: PASS.
  • Not yet checked on hdpi. It still runs calendar 1.2.9, so the warning stays until the update is installed there.

🤖 Generated with Claude Code

The cache key joined every selected calendar ID and becomes a filename.
With a few long Google calendar IDs (holidays, sports) it ran past the
255-byte filename limit, so every write failed ("Could not write cache")
and events were refetched from Google on every update. The key now
carries a 16-char sha256 of the sorted IDs instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bc9a2381-05a9-41c4-9d1a-3678d02f2b68
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ChuckBuilds
ChuckBuilds merged commit 738fe34 into main Oct 4, 2026
4 checks passed
@ChuckBuilds
ChuckBuilds deleted the fix/calendar-cache-key-length branch October 4, 2026 17:10
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.

1 participant