[Kde-pim] Proper way to sync collection moves

Daniel Vrátil dvratil at kde.org
Wed May 11 07:08:36 BST 2016


On Tuesday, May 10, 2016 3:27:53 PM CEST Krzysztof Nowicki wrote:
> Hi,
> 
> W dniu 2016-05-10 13:32:40 użytkownik Daniel Vrátil <dvratil at kde.org> 
napisał:
> > 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.
> 
> When I turned on RHIDs I actually noticed that the incremental sync doesn't
> work at all. Do I assume correctly, that in case of RHIDs when I sumbit a
> changed folder I need to provide the full collection chain up to the root?
> Otherwise the CollectionSync is unable to construct the absolute RID for
> the collection.

Yeah, that's probably correct. I think you don't need to provide real 
collections though, you just need to fill the RemoteID of the parents.

Dan

> 
> Chris
> 
> > 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/20160511/662de96b/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