[Kde-pim] How can I make Akonadi sync events ?

Kevin Krammer krammer at kde.org
Tue Feb 18 15:46:32 GMT 2014


On Sunday, 2014-02-16, 17:53:50, Martin Koller wrote:
> On Sunday 16 February 2014 13:20:41 Kevin Krammer wrote:

> > Hmm. Maybe cancelTask() is not right here, I could be better to
> > deferTask()
> > and go offline instead. Maybe retrying connect by timer.
> 
> That's it!
> When I comment out cancelTask() and just do setOnline(false) instead, the
> next time I change the resource to online, the new event is sent to the
> server. I even do not need to call deferTask().

Might still be worth calling it if it still works.
Makes the intention in the code more explicit and might allow the base code to 
do stuff.

> General question:
> When akonadi tells the resource to handle an item modification (itemAdded,
> itemChanged, itemRemoved), shouldn't the resource NEVER call cancelTask()
> because if it does, the item in akonadi's DB is different than in the
> backend and as you say there is no mechanism which would try to replay that
> modification if online, it will never ever be modified in the backend ?

Yeah, that might be a legacy behavior from earlier times and got copied by 
authors of newer resources.

> Instead, it should ALWAYS setOnline(false) in case of an error from the
> backend (or KJob trying to talk with the backend), so that the next change
> to online state replays what is in the change queue ?

Another option could be to just not complete the current task (neither cancel 
nor confirm) and doing the first delayed retry without changing state.

Cheers,
Kevin
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20140218/0481b242/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