Skip to content

Fix stale calendar events and Docker health check - #2

Merged
cookie-monster1649 merged 2 commits into
mainfrom
fix/calendar-event-staleness
Apr 15, 2026
Merged

cookie-monster1649 merged 2 commits into
mainfrom
fix/calendar-event-staleness

Conversation

@cookie-monster1649

Copy link
Copy Markdown
Owner

Summary

  • Subscription feeds: explicit window fetches (PDF generation) were advancing last_body_hash, causing the next poller cycle to fast-path past the global delete. Events removed from the feed but outside the document year would persist indefinitely. Fix: only advance last_body_hash on non-explicit (background poller) fetches.
  • CalDAV sources: no background polling meant removed CalDAV events persisted in the PDF until the next manual sync. Added CaldavPollerService (15-minute cycle, authoritative snapshot per calendar URL) and a caldav_events table. generateDocumentPDF now refreshes into the DB then reads from it, consistent with the subscription pattern.
  • Docker health check: wget --spider is a GNU wget flag unsupported by BusyBox (ships with node:22-alpine), so the health check always exited non-zero. Replaced with wget -O /dev/null.

Test plan

  • Remove an event from a subscription feed, wait for the next poller cycle, confirm it no longer appears in the generated PDF
  • Remove an event from a CalDAV calendar, wait up to 15 minutes (or trigger a sync), confirm it no longer appears
  • Deploy container and confirm health check reports healthy

🤖 Generated with Claude Code

jjmonester and others added 2 commits April 15, 2026 15:27
Two related issues where deleted events were not being cleaned up:

1. Subscription feeds: explicit window fetches (triggered by PDF generation)
   were advancing last_body_hash even though they only pruned events within
   the document year. The next non-explicit poller cycle would see a matching
   hash and fast-path past the global delete, leaving events outside the
   explicit window alive indefinitely. Fix: only advance last_body_hash on
   non-explicit (poller) fetches.

2. CalDAV sources: events were fetched live on every PDF generation with no
   background refresh, so removed CalDAV events persisted in the PDF until
   the next manual sync. Fix: add CaldavPollerService (mirrors the subscription
   poller – 15-minute cycle, authoritative snapshot per calendar URL) and a
   caldav_events table. generateDocumentPDF now triggers a fresh fetch into
   the DB then reads from it, consistent with the subscription pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wget --spider is a GNU wget flag not supported by BusyBox, which ships with
node:22-alpine. The health check was always exiting non-zero regardless of
server state. Replaced with wget -O /dev/null which achieves the same result
(discards body, exits non-zero on failure) with the BusyBox implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cookie-monster1649
cookie-monster1649 merged commit 31a79f6 into main Apr 15, 2026
1 check passed
@cookie-monster1649
cookie-monster1649 deleted the fix/calendar-event-staleness branch April 15, 2026 05:29
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