When syncing from a remote ICS file via the http storage type, vdirsyncer does not report a parsing error when the ICS file is missing END:VEVENT and END:VCALENDAR lines. Instead, it proceeds as if the ICS file were valid but contained no events. Although the invalid ICS file clearly needs to be fixed by whoever is producing it, I think that vdirsyncer should also let users know when a file is invalid.
Background
I recently ran into problems with vdirsyncer reporting that one of my calendars was empty (error: Storage "calendar_remote" was completely emptied.). This calendar is simply pulling from a published Outlook calendar (a .ics file) using the http storage type. I know that the calendar is not empty, and looking at it via Outlook's web UI comfirmed this.
I think there remains an issue in vdirsyncer, though -- it should report a parsing error when it encounters this invalid ICS file. Reporting these errors would make troubleshooting simpler when something goes wrong.
Further, if the local calendar has no events, vdirsyncer reports no error at all but fails to sync the events from the remote calendar. The test setup below reproduces this issue. Once again, vdirsyncer should be reporting a parsing error to the user, not reporting that the sync completed successfully.
Minimal setup to reproduce
vdirsyncer version: 0.19.2
Python version: 3.11.6
OS: Arch Linux
Config:
[general]
status_path = "~/.config/vdirsyncer/status/"
[pair test_cal]
a = "test_cal_remote"
b = "test_cal_local"
collections = null
[storage test_cal_local]
type = "filesystem"
path = "~/scratch/test-cal/"
fileext = ".ics"
[storage test_cal_remote]
type = "http"
url = "http://localhost:8080/cal.ics"
Steps to reproduce:
Create the ~/scratch/test-cal directory.
Copy the cal.ics file contents below into a file named cal.ics.
From within the directory containing cal.ics, run python -m http.server 8080 to make the file available locally over HTTP.
Run vdirsyncer discover test_cal.
Run vdirsyncer -vdebug sync test_cal.
Expected result: A parsing error is reported.
Actual result: No error is reported, as seen in the vdirsyncer sync output below. However, no events are added to the ~/scratch/test-cal directory either.
Problem
When syncing from a remote ICS file via the http storage type, vdirsyncer does not report a parsing error when the ICS file is missing
END:VEVENT
andEND:VCALENDAR
lines. Instead, it proceeds as if the ICS file were valid but contained no events. Although the invalid ICS file clearly needs to be fixed by whoever is producing it, I think that vdirsyncer should also let users know when a file is invalid.Background
I recently ran into problems with vdirsyncer reporting that one of my calendars was empty (
error: Storage "calendar_remote" was completely emptied.
). This calendar is simply pulling from a published Outlook calendar (a.ics
file) using the http storage type. I know that the calendar is not empty, and looking at it via Outlook's web UI comfirmed this.After a bit of digging, I discovered that Outlook is publishing bad ICS files -- all events except the last are missing the
END:VEVENT
, and the file does not have anEND:VCALENDAR
. This issue has been reported to Microsoft and will hopefully be fixed soon: https://answers.microsoft.com/en-us/outlook_com/forum/all/ics-files-are-missing-end-nodes/fb2e1cc7-eed5-43e2-a62f-bebc653e119f.I think there remains an issue in vdirsyncer, though -- it should report a parsing error when it encounters this invalid ICS file. Reporting these errors would make troubleshooting simpler when something goes wrong.
Further, if the local calendar has no events, vdirsyncer reports no error at all but fails to sync the events from the remote calendar. The test setup below reproduces this issue. Once again, vdirsyncer should be reporting a parsing error to the user, not reporting that the sync completed successfully.
Minimal setup to reproduce
vdirsyncer version: 0.19.2
Python version: 3.11.6
OS: Arch Linux
Config:
Steps to reproduce:
~/scratch/test-cal
directory.cal.ics
file contents below into a file namedcal.ics
.cal.ics
, runpython -m http.server 8080
to make the file available locally over HTTP.vdirsyncer discover test_cal
.vdirsyncer -vdebug sync test_cal
.Expected result: A parsing error is reported.
Actual result: No error is reported, as seen in the
vdirsyncer sync
output below. However, no events are added to the~/scratch/test-cal
directory either.cal.ics
file contents:P.S.
vdirsyncer has been an awesome tool for me. Thank you to everyone who's helped make it what it is!