[horde] cleanup of horde_histories when removal of calendar or removeUserData()

Michael J Rubinsky mrubinsk at horde.org
Tue Jun 10 14:50:03 UTC 2014

Quoting Steffen <skhorde at smail.inf.fh-bonn-rhein-sieg.de>

> On Fri, 6 Jun 2014, Michael J Rubinsky wrote:
>> Quoting Steffen <skhorde at smail.inf.fh-bonn-rhein-sieg.de>
>>> after I've setup Horde 5 (horde 5.1.6 stable), I'm testing to  
>>> remove user data from it currently.
>>> It looks like many - if not all - entries remain in  
>>> horde_histories, if I use the horde-remove-user-data script to  
>>> remove an user. Actually for testing purpose I have removed all  
>>> users from my DB. :-)
>>> If I remove a calendar, all events get a history item with action  
>>> "delete". However, if the calendar is gone, which parts /  
>>> functions will access that item ever? Because the "add" log entry  
>>> does not contain any data, you cannot rebuilt a deleted event with  
>>> that information.
>>> I suppose that applies to any other folder-like object (container)  
>>> as well, such as notepads, addressbooks,& tasks.
>>> If one removes an user with removeUserData() or the  
>>> horde-remove-user-data script, those entries remain as well. And  
>>> because the container is gone, you cannot know, to which user the  
>>> entry belongs to. history_who contains the deleter, which probably  
>>> is an admin, e.g. for the script.
>>> My question is: would it harm, if one removes the history items,  
>>> when the parent container (calendar, address book, ...) of the  
>>> object is removed?
>>> Or if the immediate removal is not appropriate, could the history  
>>> maintain a field like "timestamp when parent container got  
>>> removed", so one can run a database cleanup with this information  
>>> on a regular base?
>>> I suppose to let each Horde app handle the cleanup itself is  
>>> required, because the naming convention of object_uid is app  
>>> depended and you cannot guess how to verify the existance of the  
>>> parent from the object_uid value with an outside script for sure.
>> The delete entries are required for synchronization.  If you remove  
>> them,  and synchronization clients that have not connected since  
>> the deletion took place will never know to remove the items. 
> Hm, I thought that if the calendar or parent container is gone, no  
> client would be able to query the status of the event or other  
> object anymore, because they must query the container first.
> OK, makes sense if this assumption is wrong.
> Thanks,
> -- 
> Steffen
If that were the case,  you would never be able to synchronize deletions. 

The history system is polled first,  to determine only if there are  
any adds,  edits,  or deletions. Once we know changes are present,  
 the host application is polled if more information is needed about  
the change (this is not the case for deletions,  as all we need to  
know is that it was deleted). 

Sent from mobile 

-------- Original message --------
From: Steffen <skhorde at smail.inf.fh-bonn-rhein-sieg.de>
Date:06/10/2014  10:43 AM  (GMT-05:00)
To: horde at lists.horde.org
Cc: horde at lists.horde.org
Subject: Re: [horde] cleanup of horde_histories when removal of  
calendar or removeUserData()

More information about the horde mailing list