fix(calendar): hash calendar IDs in the events cache key (1.2.12) - #613
Merged
Merged
Conversation
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>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
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.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
On hdpi the calendar logs this warning on every update:
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.jsonwas regenerated withupdate_registry.py. Core floor is unchanged.Testing
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.🤖 Generated with Claude Code