Importing updated event breaks database due to duplicate UID
Open
Nobody has claimed this yet.
pri:High
type: bug
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 233
- Avg merge
- 1h 44m
- Merged PRs (30d)
- 1
Description
When someone updates a calendar event, and I import the resulting ICS "updated invitation", then khal inserts a new record, causing a duplicate UID conflict:
error: madduck_calendar/calendar.ics: Storage "madduck_calendar_local/calendar.ics" contains multiple items with the same UID or even content. Vdirsyncer will now abort the synchronization of this collection, because the fix for this is not clear; It could be the result of a badly behaving server. You can try running:
error:
error: vdirsyncer repair madduck_calendar_local/calendar.ics
error:
error: But make sure to have a backup of your data in some form. The offending hrefs are:
error:
error: '35f41be794204ef89e5e055bdf86b800.ics'
error: '6448594d644f4976babb5d1f4cf6e2b0.ics'
It should really check if there's already an event with the UID, and if so, then update it.
For the record, repair fixes the issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace khal's import path for an updated ICS invitation and inspect how an existing UID is handled before insertion. Reproduce the duplicate-UID scenario described in the issue, then verify that importing the updated invitation updates the existing event without requiring vdirsyncer repair.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100