[Kde-pim] Proper way to sync collection moves

Daniel Vrátil dvratil at kde.org
Tue May 10 12:32:40 BST 2016


On Tuesday, May 10, 2016 12:07:19 PM CEST Krzysztof Nowicki wrote:
> Hi,

Hi, 


> I've been debugging some collection sync issues in the EWS resource and I
> wonder what is the correct way to tell Akonadi that a collection was moved.
> 
> What happens now is that when I move a folder from one parent to another I
> receive a notification from Exchange that the moved folder has changed. This
> triggers a collection tree sync for the resource. The EWS resource then
> retrieves the details about the folder including the new parent collection.
> It then creates an empty local collection for the folder, populates it with
> data and also creates an empty collection for the parent folder only to
> give an indication about the parent remote id. Finally it uses
> collectionsRetrievedIncremental() to deliver the updated collection.
> 
> Unfortunately what I see is that Akonadi creates a new collection under the
> new parent instead of reparenting the existing collection. The old
> collection is not deleted, which leads to two collections with the same
> remote id. I was expecting that it would figure out that there is already
> an existing collection with the same remote id and would update it instead
> of creating a new one.

Using Hierarchical Remote IDs (HRIDs) should help so try enabling 
ResourceBase::setHierarchicalRemoteIdentifiersEnabled(). With HRIDs the 
CollectionSync will always consider the parent collection chain when resolving 
move. Without HRID, just having "kde-pim" as an identifier could be ambiguous. 
But when you enable HRID Akonadi will also consider parent RemoteID, thus 
disambiguating "kde-pim" collections in "INBOX/ml/kde-pim" and "INBOX/commits/
kde-pim" 

Looking into CollectionSync, the move detection path is only enabled when 
HRIDs are enabled, so try that.

Dan

> 
> Is there something I'm doing wrong?
> 
> Regards
> Chris
> _______________________________________________
> KDE PIM mailing list kde-pim at kde.org
> https://mail.kde.org/mailman/listinfo/kde-pim
> KDE PIM home page at http://pim.kde.org/


-- 
Daniel Vrátil
www.dvratil.cz | dvratil at kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20160510/15176f50/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list