Baikal: Delete old card entries

Created on 15 Jan 2018  路  5Comments  路  Source: sabre-io/Baikal

Hello,

I think it would be nice to add an option to delete card entries older than X days.

As a temporary solution I added the following at the very beginning of createCalendarObject(), in vendor/sabre/dav/lib/CalDAV/Backend/PDO.php :

Using MySQL :

$stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarObjectTableName . ' where lastoccurence < ((select UNIX_TIMESTAMP())-?)');
$stmt->execute(array(365*86400));

Using SQLite :

$stmt = $this->pdo->prepare('DELETE FROM ' . $this->calendarObjectTableName . ' where lastoccurence < ((SELECT strftime("%s", "now"))-?)');
$stmt->execute(array(365*86400));

Old card entries are then deleted when a new one is added.

Thank you very much !

Ben

wontfix

All 5 comments

I think is is an unlikely to be implemented. Not a big fan of automatically removing historical data.

Thank you for your feedback @evert.
Perhaps this could be implemented as (a per calendar) option ?
Pruning old events, such as useless one year old events, to avoid syncing / keeping them across all the synced devices could make sense :)
We could make the duration to keep events as the configuration option, 0 to keep undefinitely, or greater than 0 as the number of days after which events are deleted.
Without this there's no way to clean history...
Thank you :+1:

I am not entirely against the concept, but there's a lot of other bugs and features, and frankly I think it's unlikely that this will make it to the top of the list. There's bigger fish to fry and I believe it's better if the Github issues list reflect work that needs to be done in the short term.

Reopening for now. If nothing happens here in a year, lets close it =)

I think that this should remain a client function. In iOS calendar, I can set such a limit on how far back to sync events.

Also, I would prefer to archive & delete appointments from the client end. If and when I want things to happen automatically, I will set up a cron job on one of the clients.

Just my 2 cents anyway.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ladetto picture ladetto  路  5Comments

gitfvb picture gitfvb  路  4Comments

daimaire picture daimaire  路  3Comments

tuxtlequino picture tuxtlequino  路  5Comments

GrayGhost93 picture GrayGhost93  路  5Comments