pimutils / vdirsyncer

📇 Synchronize calendars and contacts.

Home Page:https://vdirsyncer.pimutils.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a `pre_deletion_hook`

chrisblech opened this issue · comments

Use-Case

The events of a calendar A (connected via an iCal feed) need to be filtered and/or modified using a script and then copied into a calendar B (connected via WebDav).

Technical Approach

Calendar A is connected using html and synchronized with a filesystem storage. The filtering and modification of events occur through a post_hook: only the desired events are stored in a different directory, also using a filesystem storage. These events are then synchronized with the target calendar, which is connected as caldav.
Details: https://gist.github.com/chrisblech/02d57187e13f2e393320533872fb8f94

Problem

When an event is deleted in the source calendar (or modified in a way that changes the filename/UID), this deletion/modification cannot be synchronized between the two filesystem storages because, in the case of deletion, the post_hook is not invoked. As a result, deleted events persist in the target calendar, and modified events appear multiple times.

Proposed Solution

Extend the existing code to allow the invocation of a pre_deletion_hook even when an event is deleted.