[Akonadi] [Bug 335090] Akonadi Dav Resource: Broken State / Unexpected Error 401

Ingo Ratsdorf ingo at envirology.co.nz
Mon Aug 25 22:00:00 BST 2014


--- Comment #21 from Ingo Ratsdorf <ingo at envirology.co.nz> ---
The way the resource is designed is the following:

Say we delete an event from Calendar in KOrganizer:

1) Akonadi calls item-deleted function in resource
2) Resource grabs url and etag and send a delete request to the caldav server
together with an if-match header and the stored etag.
3) If everything worked, resource deletes item from akonadi collection
Now comes the tricky bit:
If the above DOES NOT WORK (because the item was changed meanwhile before we
sent that delete request), the resource gets a 412 error back from the server
and calls its retry function and that does emit broken, offline.

So in order for this to work, we need to introduce conflict resolution

Ie in the above, have three exclusive options: 1) ask the user for input, 2)
delete anyway (we are the boss), 3) reload from server.

This currently does not work as the dav job is not given to the retry function,
only the error message.

So I am working on some user configurable conflict resolution and properly
handle the retry function.

In the above example of deleting an element:

1) Ask user for input and then do one of the below
2) Server wins: ignore delete request and start new job to retrieve updated
item from DAV server - if that fails, either ignore silently or notify user
3) Client wins: Restart the job without the if-match header, delete the item.
If that fails, delete item from collection only, and/or notify user

This all will need some proper handling of the various error codes, ie 401 and
501 probably should set the resource offline, 412 should update items, etc.
It will also need a check whether the server went away and the resource should
then go offline too.

You are receiving this mail because:
You are the assignee for the bug.

More information about the Kdepim-bugs mailing list