[Kde-pim] Akonad tags support broken?

Daniel Vrátil dvratil at kde.org
Thu Mar 10 21:45:20 GMT 2016


On Thursday, March 10, 2016 10:19:46 PM CET Krzysztof Nowicki wrote:
> Hi,

Hi Chris!

> 
> While working on EWS support and server-side tags I've noticed that the tag
> support in Akonadi/KDE PIM is somewhat incomplete/broken.

Yeah, the implementation is not very well tested (read: it sucks).

> Tags support remote identifiers (similar to items and collections).
> Unfortunately adding remote IDs to tags is broken at the Akonadi database
> layer (at least with PostgreSQL). The autogenerated SQL code tries to return
> the id of the row, which is not present in the
> 'tagremoteidresourcerelationtable' as it is an n:m relation table. I have
> managed to work around this by manually adding the id column to that table.

Oh, I thought I fixed this, but looking at the code: I did not :) Probably 
needs a special case in the XSLT file.

> The ObserverV4::tagAdded() is not guaranteed to be called for all tags in
> the database. This leads to a situation where the resource receives a call
> to ObserverV4::itemsTagsChanged() with tags that it has never seen before -
> I would expect an ObserverV4::tagAdded() call for each of them that doesn't
> have a remote identifier for this resource.

Looks like corner case in the notification logic. A Tag can exist in Akonadi 
without your resource knowing about it (for example because it was created on 
an email belonging to another resource). Tagging an Item that belongs to your 
resource then causes your resource to get itemTagsChanged() notification about 
a tag it has never seen before.

> I have enabled fetching tags in the change recorder so that I can see a full
> list of tags for an item that I get in ObserverV4::itemsTagsChanged().
> Unfortunately the tags I don't contain the gid, which I need to identify
> them in the absence of remote ID. It seems there is no way to tell a
> TagFetchScope to fetch the gid of the tag.

You should still be getting Tag ID though, so you could retrieve the (unknown) 
Tag manually, store it on the server, assign it a remote ID and store it back 
to Akonadi. I  can't find the notes about tags now, but that might even be the 
designed behaviour.

> Does this all mean that tag support is incomplete and should not be used? I
> would really love to implement this as Exchange allows to do it nicely and I
> personally use tags very often.

Your resource would be the first one to seriously implemented tags support. 
The Kolab resource has some support, but it most probably suffers from similar 
problems.

Would you mind creating Phabricator tasks for the issues you ran into? With 
known usecases I can create unit test and try to fix the issues (or you can 
try ;-))

Cheers,
Daniel

> 
> 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/20160310/b22bdeb2/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