pimutils / pimutils/vdirsyncer

parsing of long or multiple lines for a single entry

Open
#801 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.9k
Forks
185
Avg merge
11h 49m
Merged PRs (30d)
1

Description

If a line, for example the entry LOCATION in the synced ics file contains more than 80 characters or is (broken up and then) followed by another line not pertaining to a new entry, then a client error 400 is thrown on syncing. It disappears as soon as the offending line is removed.

  • Your vdirsyncer version: 0.16.6
  • If applicable, which server software (and which version) you're using
  • Your Python version 3.6.5
  • Your operating system OpenSUSE 15
  • Your config file:
[pair Calendar]
a = "CalendarLocal"
b = "CalendarRemote"
# collections = ["private", "work"]
collections = ["from b"]

# Calendars also have a color property
metadata = ["calendar", "blue"]

# To resolve a conflict the following values are possible:
#   `null` - abort when collisions occur (default)
#   `"a wins"` - assume a's items to be more up-to-date
#   `"b wins"` - assume b's items to be more up-to-date
conflict_resolution = "a wins"

[storage CalendarLocal]
type = "filesystem"
path = "~/.local/share/vdirsyncer/calendars/"
fileext = ".ics"

[storage CalendarRemote]
type = "caldav"
url = "https://spica.t-online.de"
username = "konfekt@t-online.de"
password.fetch = ["command", "pass", "t-online"]
  • Use vdirsyncer -vdebug for debug output:
error: Unknown error occured for restCalendar/USER_CALENDAR-MAIN: 400 Client Error:  for url: https://spica.t-online.de/spica-calendar/caldav/principals/konfekt@t-online.de/calendars/USER_CALENDAR-MAIN/120049010000000065340288-ZOOM954798596OCCURRENCE1560614400000.ics
error: Use `-vdebug` to see the full traceback.
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/cli/utils.py", line 74, in handle_cli_error
debug:     raise e
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/sync/__init__.py", line 153, in sync
debug:     partial_sync
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/sync/__init__.py", line 274, in run
debug:     partial_sync)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/sync/__init__.py", line 177, in run
debug:     self._run_impl(a, b)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/sync/__init__.py", line 228, in _run_impl
debug:     self.dest.storage.update(meta.href, self.item, meta.etag)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/storage/base.py", line 15, in inner
debug:     return f(self, *args, **kwargs)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/storage/base.py", line 15, in inner
debug:     return f(self, *args, **kwargs)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/storage/dav.py", line 546, in update
debug:     href, etag = self._put(self._normalize_href(href), item, etag)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/storage/dav.py", line 520, in _put
debug:     headers=headers
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/storage/dav.py", line 390, in request
debug:     return http.request(method, url, session=self._session, **more)
debug:   File "/usr/lib/python3.6/site-packages/vdirsyncer/http.py", line 163, in request
debug:     r.raise_for_status()
debug:   File "/home/konfekt/.local/lib/python3.6/site-packages/requests/models.py", line 935, in raise_for_status

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the traceback path in sync/init.py and storage/dav.py, especially update(), _put(), and request(), then reproduce the sync using an ICS entry with a long or folded LOCATION line. Done means the affected entry syncs successfully without the reported HTTP 400 error; the issue does not identify a specific test or implementation file.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.