Skip to content

Fix Google Calendar connect: cid requires a webcal:// URL - #70

Merged
escalopa merged 1 commit into
mainfrom
fix/google-calendar-webcal
Aug 3, 2026
Merged

Fix Google Calendar connect: cid requires a webcal:// URL#70
escalopa merged 1 commit into
mainfrom
fix/google-calendar-webcal

Conversation

@escalopa

@escalopa escalopa commented Aug 3, 2026

Copy link
Copy Markdown
Owner

The bug (user report: calendar adds fine, but prayer times never appear)

The Connect Google Calendar button built calendar.google.com/calendar/render?cid=<https://…feed>. Google's cid parameter requires a webcal:// URL — with https:// it happily adds the calendar but treats the value as an opaque calendar ID and never fetches the feed. Result: subscription "succeeds", zero events. (Documented behavior; confirmed in multiple community reports.)

Proof the rest of the pipeline is healthy

I self-tested end-to-end against the live testing deployment (signed real Mini App init-data → created a subscription → fetched the feed exactly as Google does, unauthenticated):

Check Result
Create subscription HTTP 200
Feed fetch HTTP 200, text/calendar; charset=utf-8, ETag
ICS validity BEGIN:VCALENDAREND:VCALENDAR, strict CRLF, 181 events (30 days × 6 prayers + occasions)
Conditional refresh If-None-Match304

So the generator and the serving endpoint are correct — the failure is isolated to the add-flow URL scheme.

Fix

  • app.js: convert the feed URL to webcal:// inside cid (the copy-link button keeps https://, which is correct for Google's manual Other calendars → From URL flow).
  • Regression test: the connect link must embed a webcal:// URL.
  • sw.js → v11; request-flows.md documents the scheme requirement.

Note for affected users (including the reporter)

The previously added broken calendar won't heal itself: remove it in Google Calendar, then press Connect again after this deploys. Also remember Google refreshes subscribed calendars on its own schedule (commonly 12–24 h) — but the initial fetch after a webcal add happens promptly.

🤖 Generated with Claude Code

The "Connect Google Calendar" button passed the https:// feed URL inside
calendar.google.com/calendar/render?cid=. Google accepts that link and adds
the calendar, but treats an https URL in cid as an opaque identifier and never
fetches the feed, so no prayer events ever appear. Converting the feed URL to
the webcal:// scheme inside cid makes Google subscribe and pull events.

Verified end-to-end against the testing deployment before the fix: the feed
itself is healthy (HTTP 200, text/calendar, strict CRLF, 181 events over 30
days, ETag + 304 conditional refresh), isolating the failure to the add-flow
URL scheme.

- app.js: embed the feed as webcal:// inside cid (copy-link stays https for
  Google's manual From URL flow); sw.js cache bumped to v11
- test: the connect link must embed a webcal:// URL
- docs: request-flows documents the cid scheme requirement

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@escalopa
escalopa merged commit 766c40e into main Aug 3, 2026
4 checks passed
@escalopa
escalopa deleted the fix/google-calendar-webcal branch August 16, 2026 00:41
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