[Kde-pim] Help with crash from CalDav

Volker Krause vkrause at kde.org
Sun Oct 7 11:07:17 BST 2012


On Monday 01 October 2012 16:00:29 David Faure wrote:
> On Sunday 30 September 2012 12:24:13 Allen Winter wrote:
> > What it be the worst thing in the world to not assert then?
> > This is just "one of those things" that is nearly impossible to find.
> > 
> > maybe just a kWarning?
> 
> IRC we fixed rather important bugs in the imap resource, from such asserts.
> 
> This is just "one of those things" that are better caught early than late...
> you get other even weirder bugs if you don't respect the resourcebase
> contract.

Exactly, worst case scenario on misuse is incomplete syncs that could make 
data disappear.

> My suggestion for a long-term solution to this would be that ResourceBase
> should rather call factory methods that return jobs (created by the
> resource, with its own stuff added in a subclass), rather than this
> procedural "start this", "ok I'm done". Then we could track the lifetime of
> these jobs, and have a single list of jobs (rather than the resourcebase
> having some notion of the current job, and the resource having another
> notion of the current job).
> 
> (s/job/task/g if it makes this easier to understand -- currently resources
> tend to create "tasks" internally for this)

Yep, I'm also not really happy with the ResourceBase design. The reason it 
ended up the way it is now was to make it as easy as possible to implement a 
basic resource. This is why you only have to derive from one class, have all 
tasks serialized, and have built-in syncing code.

While I still think that goal makes sense, we lack flexibility for the 
async/complex cases and for backend-specific optimizations. One option would 
be to have a much more basic base class and make the individual building 
blocks (scheduler, syncer) available in public API as well. On top of that we 
can add convenience base classes similar to what you and Kevin described (for 
the common case of serialized async resources) and one similar to the current 
ResourceBase (for simple synchronous resources).

regards,
Volker
-------------- 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/20121007/7be9a746/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