Fix Google Calendar connect: cid requires a webcal:// URL - #70
Merged
Conversation
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>
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.
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'scidparameter requires awebcal://URL — withhttps://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):
text/calendar; charset=utf-8, ETagBEGIN:VCALENDAR…END:VCALENDAR, strict CRLF, 181 events (30 days × 6 prayers + occasions)If-None-Match→ 304So 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 towebcal://insidecid(the copy-link button keepshttps://, which is correct for Google's manual Other calendars → From URL flow).webcal://URL.sw.js→ v11;request-flows.mddocuments 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