Repository navigation
Calendar import: ICS upload and ICS URL subscriptions - #11
Merged
rooty-bot merged 2 commits intoNov 30, 2026
Merged
Conversation
Parse ICS with ical.js and expand recurring events (EXDATE, moved and cancelled instances, orphan overrides) within the last 13 months to one month ahead. Times resolve via IANA zones, the file's VTIMEZONE (Outlook names) or TZ for floating and all-day events. Occurrences are stored as calendar time entries keyed by UID and original start: re-syncs update in place and remove events gone from the feed; uploads only upsert. Settings lists ICS subscriptions with Sync now, delete and an all-day toggle; ICS_SYNC_MINUTES (default 60) schedules syncs. Time page takes .ics uploads and lists calendar entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ical.js treats TZIDs it has not registered as floating, so it compared a UTC UNTIL or EXDATE with wall-clock times and kept extra occurrences (e.g. Google's "this and following" splits). Also cap parse errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Thanks for this, it's a really careful piece of work! I reviewed it against #4 point by point and it covers everything the issue asks for. Scope vs #4
Verified locally: Security:
Small nits, none blocking, fine as follow-ups:
Nice job on the DST and Outlook-zone handling and on the history-preserving removal logic. Approving. 🎉 -- OpenSourcerer (Rootshift review) |
rooty-bot
deleted the
claude/4-calendar-import-ics-upload-and-ics-url-s
branch
November 30, 2026 12:09
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.
Adds calendar import: ICS URL subscriptions on Settings and
.icsuploads on Time. Events land intime_entrieswithsource = calendar.What changed
src/lib/server/ics.ts) uses ical.js, which is Mozilla-maintained and has no dependencies.Intl. Outlook-style names likeW. Europe Standard Timeuse the file's own VTIMEZONE. Floating and all-day times useTZ.UNTILorEXDATEon a zoned series is applied by UTC instant, which ical.js would otherwise get wrong.src/lib/server/calendars.ts)category_idsurvive, and a moved instance stays the same row.ICS_SYNC_MINUTES(default 60,0= off). On start, and then every minute, subscriptions not attempted within the interval are synced. Timers areunref'd and runs never overlap.settings) controls them; turning it off removes them from feeds on the next sync.BODY_SIZE_LIMIT=20M, because adapter-node's 512K default would reject real calendar exports.004_calendars.sqladds acalendarstable andtime_entries.calendar_id(withON DELETE CASCADE).ICS_SYNC_MINUTES,TZandBODY_SIZE_LIMIT.How it was tested
.icsfiles insrc/lib/server/testing/fixtures/back the tests:calendars.spec.tscovers idempotent re-sync (zero changes, stable ids), in-place updates, removals, history kept outside the window, two feeds sharing UIDs, failure safety, the all-day toggle, upload upserts and scheduling.settings/page.server.spec.tsdrives the form actions end to end.nowand the default zone, and also pass underTZ=Pacific/Auckland,America/DenverandAsia/Kolkata.npm run lint,npm run check,npm test(88 tests) andnpm run buildall pass locally. I also ran the built server against a local ICS server, uploading a file and adding a subscription, and confirmed the URL path never reaches the page.--ignore-scripts, because this machine has nomake(better-sqlite3 ships prebuilds). CI installs normally. Docker isn't available here, so CI builds the image.Closes #4
🤖 Generated with Claude Code