[Kde-pim] Re: Bug? CollectionFetchJob doesn't always work after AgentInstanceCreateJob

Kevin Krammer kevin.krammer at gmx.at
Sun May 15 21:25:25 BST 2011


On Sunday, 2011-05-15, David Jarvie wrote:
> On Sunday 15 May 2011 20:53:55 Kevin Krammer wrote:
> > AgentInstance:reconfigure() is a D-Bus call from one process into another
> > so there is always some level of concurrency.
> > 
> > Most resources react to the reconfigure call by checking their current
> > config and when it makes sense requesting a synchronization of their
> > collection tree. Which involves yet another process (Akonadi server) and
> > is delayed (as in event loop processing continues right away).
> > 
> > So it is a matter of timing if the resource has had time to receive its
> > retrieveCollections call and answer it.
> > A CollectionFetchJob can therefore see any number of collections on that
> > resource, e.g. 0 if the call hasn't been processed yet, more but not all
> > if the retrieval is streamed but has not yet finished, or all.
> 
> Is there any way for the application to wait until the retrieveCollections
> call has completed? Or should it just keep retrying the CollectionFetchJob
> until it returns either a collection or an error?

Unfortunately there is currently no way to get signalled when collection tree 
sync is finished (there is only a signal for when a complete sync has 
finished).

An earlier version of the mail migrator used a combination of collection fetch 
job and watching the resource status changes, i.e. basically waiting for the 
Working->Idle transition and then triggering the fetch job.

For the record I ended up creating the collections from the migrator side, 
which it could do because it has exceptional knowledge about the resources it 
migrates to (it can fake being the resource).

We should probably extend the resource interface so it can provide this kind 
of "finished with task" signalling.

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/20110515/ecc1e878/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