Bug 387580 - Error response is not handled correctly in EwsGetFolderRequest
Summary: Error response is not handled correctly in EwsGetFolderRequest
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: EWS Resource (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krzysztof Nowicki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-04 12:05 UTC by Stefan Brüns
Modified: 2018-05-03 22:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Handle Error in GetFolderResponseMessage (1.32 KB, patch)
2017-12-04 12:07 UTC, Stefan Brüns
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Brüns 2017-12-04 12:05:48 UTC
(Copy of https://github.com/KrissN/akonadi-ews/issues/46 )

After I deleted a folder from outside kontact (i.e. a different kontact on another computer), akonadi-ews was no longer able to synchronize the account.

The server responds with the following message (shortened and reformatted):

<?xml version="1.0" encoding="utf-8"?>                                                                                                            
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">                                                                                  
  <s:Header>                                                                                                                                      
    <h:ServerVersionInfo xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MajorVersion="15" MinorVersion="1" MajorBuildNumber="1034" MinorBuildNumber="26" Version="V2017_01_07"/>                                                                            
  </s:Header>                                                                                                                                     
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">                                     
    <m:GetFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">                                                                                                                                
      <m:ResponseMessages>                                                                                                                        
        <m:GetFolderResponseMessage ResponseClass="Success">                                                                                      
          <m:ResponseCode>NoError</m:ResponseCode>                                                                                                
          <m:Folders>                                                                                                                             
            <t:Folder>                                                                                                                            
              <t:FolderId Id="AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAabzMAAA=" ChangeKey="AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHv5W0h"/>                                                                                      
            </t:Folder>                                                                                                                           
          </m:Folders>                                                                                                                            
        </m:GetFolderResponseMessage>                                                                                                             
        <m:GetFolderResponseMessage ResponseClass="Error">                                                                                        
          <m:MessageText>The specified object was not found in the store., The process failed to get the correct properties.</m:MessageText>      
          <m:ResponseCode>ErrorItemNotFound</m:ResponseCode>                                                                                      
          <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>                                                                                          
          <m:Folders/>                                                                                                                            
        </m:GetFolderResponseMessage>                                                                                                             
        <m:GetFolderResponseMessage ResponseClass="Success">                                                                                      
          <m:ResponseCode>NoError</m:ResponseCode>                                                                                                
          <m:Folders>                                                                                                                             
            <t:Folder>                                                                                                                            
              <t:FolderId Id="AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAafAvAAA=" ChangeKey="AQAAABYAAADVV7DQctuIRYeYB4MK+03/AACZqJhD"/>                                                                                      
            </t:Folder>                                                                                                                           
          </m:Folders>                                                                                                                            
        </m:GetFolderResponseMessage>                                                                                                             
      </m:ResponseMessages>                                                                                                                       
    </m:GetFolderResponse>                                                                                                                        
  </s:Body>                                                                                                                                       
</s:Envelope>
Comment 1 Stefan Brüns 2017-12-04 12:07:27 UTC
Created attachment 109204 [details]
Handle Error in GetFolderResponseMessage
Comment 2 Stefan Brüns 2018-05-03 22:40:06 UTC
Git commit fb676a19e8d4655ec50f5fbf111df3fc650835f5 by Stefan Brüns.
Committed on 03/05/2018 at 22:39.
Pushed by bruns into branch 'master'.

Handle Error in GetFolderResponseMessage

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.

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

Reviewers: dvratil, nowicki

Reviewed By: dvratil

Subscribers: #kde_pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D12475

M  +5    -1    resources/ews/ewsclient/ewsgetfolderrequest.cpp

https://commits.kde.org/kdepim-runtime/fb676a19e8d4655ec50f5fbf111df3fc650835f5
Comment 3 Stefan Brüns 2018-05-03 22:40:06 UTC
Git commit 05546e3dfd84dcdfd80a84f14f57b9a874ce4db2 by Stefan Brüns.
Committed on 03/05/2018 at 22:39.
Pushed by bruns into branch 'master'.

Handle Error in GetFolderResponseMessage

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.

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

Reviewers: dvratil, nowicki

Reviewed By: dvratil

Subscribers: #kde_pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D12475


https://commits.kde.org/kdepim-runtime/05546e3dfd84dcdfd80a84f14f57b9a874ce4db2