Handle Error in GetFolderResponseMessage
ClosedPublic

Authored by bruns on Apr 23 2018, 6:01 PM.

Details

Summary

In case a Folder which no longer exists is updated, the server responds
with a GetFolderResponseMessage with ResponseClass="Error". This happens
if the internal cache still contains a folder, but the folder has been
deleted meanwhile (e.g. through the web client).

The message contains an empty Folders element which has to be skipped,
otherwise the outer loop for the GetFolderResponseMessages will try to
traverse the (nonexisting) Folders element on readNextStartElement.

BUG: 387580

Test Plan

Create a new folder (either using web client or kontact)
Make sure it appears in kontact
Delete it in the web client (or using kontact on another computer)
Try to sync the resource

Diff Detail

Repository
R44 KDE PIM Runtime
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns requested review of this revision.Apr 23 2018, 6:01 PM
bruns created this revision.
dvratil set the repository for this revision to R44 KDE PIM Runtime.
Restricted Application added a project: KDE PIM. · View Herald TranscriptApr 24 2018, 8:13 AM
dvratil accepted this revision.May 2 2018, 6:00 AM

Can't test, but looks OK to me.

This revision is now accepted and ready to land.May 2 2018, 6:00 AM
bruns added a comment.May 2 2018, 2:54 PM

Can't test, but looks OK to me.

In the referenced bug, https://bugs.kde.org/show_bug.cgi?id=387580, there is a response XML snippet which could be used to create a unit test case.

This revision was automatically updated to reflect the committed changes.