Skip to content

[codex] fix stale Cloudflare calendar cache - #9

Merged
aaronshivers merged 1 commit into
masterfrom
codex/fix-cloudflare-kv-refresh
Jul 2, 2026
Merged

aaronshivers merged 1 commit into
masterfrom
codex/fix-cloudflare-kv-refresh

Conversation

@aaronshivers

Copy link
Copy Markdown
Owner

Summary

Fixes the Cloudflare-connected deployment path for the calendar Worker.

The repository is already connected in Cloudflare, so deploying from GitHub is not the missing step. The issue is that the Worker serves CALENDAR_CACHE first. After a Cloudflare-connected deploy, KV can still contain an older calendar:body, causing subscribers to keep receiving stale calendar data until the monthly cron refresh runs.

This change makes the Worker compare the bundled deploy-time calendar timestamp with the stored KV timestamp. If the bundled calendar is newer, the Worker serves the fresh bundled calendar immediately and refreshes KV in the background.

Validation

  • poetry run pytest -q passed with 21 tests.
  • npm run worker:verify passed.
  • Worker smoke coverage now includes stale-KV refresh behavior.

@aaronshivers
aaronshivers marked this pull request as ready for review July 2, 2026 21:51
@aaronshivers
aaronshivers merged commit fc1cc97 into master Jul 2, 2026
1 check passed
@aaronshivers
aaronshivers deleted the codex/fix-cloudflare-kv-refresh branch July 2, 2026 21:51
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