Skip to content

Preserve Google per-event colors through calendar sync - #133

Merged
jherforth merged 2 commits into
jherforth:mainfrom
Leesam:per-event-google-colors
Aug 12, 2026
Merged

Preserve Google per-event colors through calendar sync#133
jherforth merged 2 commits into
jherforth:mainfrom
Leesam:per-event-google-colors

Conversation

@Leesam

@Leesam Leesam commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Google's API returns colorId on individually recolored events, but fetchGoogleEvents kept only three fields from each item and discarded it, so every event rendered in its calendar's color.

Resolve colorId to a hex at sync time via the /colors endpoint (cached 24h) and store it in the existing raw_data column, then surface it as event_color from getCachedEvents. Clients prefer event_color and fall back to source_color, so events left on a calendar's default color are unchanged. No schema migration needed.

Disclosure: written with AI assistance (Claude), tested by me on my own OMV/Docker install.

image

Google's API returns colorId on individually recolored events, but
fetchGoogleEvents kept only three fields from each item and discarded it,
so every event rendered in its calendar's color.

Resolve colorId to a hex at sync time via the /colors endpoint (cached
24h) and store it in the existing raw_data column, then surface it as
event_color from getCachedEvents. Clients prefer event_color and fall
back to source_color, so events left on a calendar's default color are
unchanged. No schema migration needed.
…ture

listEventColors cached its result on both paths, so one transient failure
(network blip, token-refresh race, a 5xx) pinned an empty palette for the
full 24h TTL. Because the hex is resolved into raw_data at sync time, every
event synced in that window stayed uncolored until a later sync after the
cache expired. Cache only successes; a failure now retries on the next sync
at the cost of one request, and keeps logging the error.

Also documents per-event colors in features.md and corrects two comments
that still claimed the day-view chip always carries the calendar color.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jherforth jherforth added this to the 1.8 milestone Aug 12, 2026
@jherforth
jherforth merged commit 41d1e49 into jherforth:main Aug 12, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in HomeGlow Kanban Aug 12, 2026
@jherforth

Copy link
Copy Markdown
Owner

Thanks @Leesam nice contribution! Claude developed, Claude approved. One minor tweak was made in the even a failed palette fetch gets cached.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants