Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Error in GetFolderResponseMessage #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

StefanBruens
Copy link
Contributor

In case a Folder which no longer exists is updated, the server responds
with a GetFolderResponseMessage with ResponseClass="Error".

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

Fixes #46

In case a Folder which no longer exists is updated, the server responds
with a GetFolderResponseMessage with ResponseClass="Error".

The message contains an empty Folders element which has to be skipped,
otherwise the outer loop for the GetFolderResponseMessages will try to
traverse the Folders element on readNextStartElement.
@StefanBruens
Copy link
Contributor Author

Resource debug output after applying the fix:

log_ews_resource_request: Starting GetFolder request ((EwsId(Posteingang, 0), EwsId(dbmt72, 0), EwsId(1o0lurm, 0), EwsId(1xqdb6z, 0), EwsId(gdbqv2, 0), EwsId(1v0xrcc, 0), EwsId(1ygzc31, 0), EwsId(1nid2l5, 0), EwsId(1cr4zlc, 0), EwsId(1ur3xts, 0), EwsId(1qnanbk, 0), EwsId(1qdvdtm, 0), EwsId(1xrcqqk, 0), EwsId(qswzuo, 0), EwsId(ns25zb, 0), EwsId(zk6d82, 0), EwsId(1j79hfg, 0), EwsId(13e3hq2, 0)))
log_ews_resource_proto: "<?xml version=\"1.0\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\" xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\"><soap:Header><t:RequestServerVersion Version=\"Exchange2007_SP1\"/></soap:Header><soap:Body><m:SyncFolderHierarchy><m:FolderShape><t:BaseShape>Default</t:BaseShape><t:AdditionalProperties><t:ExtendedFieldURI PropertyTag=\"0x3613\" PropertyType=\"String\"/><t:FieldURI FieldURI=\"folder:EffectiveRights\"/><t:FieldURI FieldURI=\"folder:ParentFolderId\"/></t:AdditionalProperties></m:FolderShape><m:SyncFolderId><t:DistinguishedFolderId Id=\"msgfolderroot\"/></m:SyncFolderId><m:SyncState>H4sIAAAAAAAEAGNgYGUAAotqE0tHE2NTA0ddZ3NHC10TR2djXSdnJ2ddNyMnC2cnczdLU1OD2vBgveDKvOTgksSSVOfEvMSiSgYr0nW65eekpBZ5pjBYkq43LLWoODM/j8HAOSczNa8ELBbvbG7gYmhmYKJrYOlqrmtiYZmm62Ro4aTr4mRsbO5k6WjsZuDGYOZcWhScWlSWWuSbmJeZllpcQpw+cPhwMTCIAZ0BcblHZmpRYlFyRiXIVQyCQGkDINYDqQude/XxzLZtPtM3ZZeUmx7aychw2+bMg7yz973aGJT/xPnMOw5UlLnnJAMDIwMfEAMBBxBrghgkm3KLgYGFZF0f9EF2k6rrsyA5uvbykaPr+0ZydP09TIauLIa35Ni15zohXVfDN1wout3h2j6DvZnrt+9/Bsaj9Sd9GBiYSdeVRJYLz5Ol6xxZum4wMLCRnjY4ybLrKgMDE+m6rpEc8kDAyESWLh4yYnmiZjhZdnGQZVcYWbpCyXIhMyFd2HLli5Pk5OUXF8nQla1bRI4uxhqSSwCGun9njEm3y/SnTCZZOeUmA6jqIs2ut+3fyLLrLFm6zpCuS3/mh9/kxFdeNBm6cl4okR7LQB0ESzas5XwWWbpyydKVTZauHJAu8poq4AwtBmRiBtjMFTMcfl9N/0RtQ519zR/pUNNQxqP3FA9YfynPp8BQrDWhYGG15R1qe99+lvGr/WS2vXAa6lIdp/qIzKYZTkNda/2dV1E3oh6lezi8TvekrqFnPGI9+Xf1U9nQqJzincfnUdXQ90/9P7Je/+VP5TCNezqn6/A0aqdTR+X7F/dQ1aWeqhEzzuZsnUhVlx6WeiHU01LRTGVDb2h5xRaREfvXcBvKwFRyyiYwI4zKhlYoaiVOIKOSx20o49GHly8nqWxto7JLS+PXBa+dTW2XlnHcXnyS2oam3/gTzkFdQ3czPZ7XPUOAyhWf/IV+/T1XyGzI4yxQBHfXLmWnrqH35G9lmezcQVVD3z91nT1tzXxJarv0tjfLdQXqGvpwpmbYef2nVC6kp/DfNXWeQO0kdWdDx27qlvxHHzw9vHlFaDyVa9NcRY6DHyeT2b/BZagLn+WdNWTkffxhev3zz/ol1Db0RrhtdixVkxSwkE5/uzpNncptqZCPl/5Hy5PZ9cJlaChn+mTHWiobGvJzs6CwA7Vdyqig1LKdgZMBCQAARqyIBuAXAAA=</m:SyncState></m:SyncFolderHierarchy></soap:Body></soap:Envelope>\n"
log_ews_resource_request: Starting SyncFolderHierarchy request (folder: EwsId(Distinguished: msgfolderroot), state: ff5z4d
log_ews_resource_proto: data KIO::TransferJob(0x55bfb66ffa60) "<?xml version=\"1.0\" encoding=\"utf-8\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Header><h:ServerVersionInfo MajorVersion=\"15\" MinorVersion=\"1\" MajorBuildNumber=\"1034\" MinorBuildNumber=\"26\" Version=\"V2017_01_07\" 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\"/></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/AAHv5bWZ\"/></t:Folder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:CalendarFolder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAabzVAAA=\" ChangeKey=\"AgAAABYAAADVV7DQctuIRYeYB4MK+03/AADDGugS\"/></t:"
log_ews_resource_proto: data KIO::TransferJob(0x55bfb66ffa60) "CalendarFolder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:TasksFolder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAabzaAAA=\" ChangeKey=\"BAAAABYAAADVV7DQctuIRYeYB4MK+03/AACZqJhA\"/></t:TasksFolder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:ContactsFolder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAabzWAAA=\" ChangeKey=\"AwAAABYAAADVV7DQctuIRYeYB4MK+03/AADDGtgq\"/></t:ContactsFolder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:Folder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAaujJAAA=\" ChangeKey=\"AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHF3h/Q\"/></t:Folder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:Folder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAaujRAAA=\" ChangeKey=\"AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHv5bQl\"/></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/xeTJ7HAAAAawF8AAA=\" ChangeKey=\"AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHv5bV+\"/></t:Folder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:Folder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAay1yAAA=\" ChangeKey=\"AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHF3h/a\"/></t:Folder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:Folder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAA1+RxpAAA=\" ChangeKey=\"AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHF4Zkp\"/></t:Folder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:Folder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDVV7DQctuIRYeYB4MK+03/AAB+/swzAAA=\" ChangeKey=\"AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHF3h/b\"/></t:Folder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:Folder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAbOgiAAA=\" ChangeKey=\"AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHF3h/Y\"/></t:Folder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:Folder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAabzNAAA=\" ChangeKey=\"AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHF4OXD\"/></t:Folder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:Folder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAA17Yf2AAA=\" ChangeKey=\"AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHF3h/c\"/></t:Folder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:Folder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAabzZAAA=\" ChangeKey=\"BQAAABYAAADVV7DQctuIRYeYB4MK+03/AACZqJQP\"/></t:Folder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:Folder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAabzPAAA=\" ChangeKey=\"AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHv5bMf\"/></t:Folder></m:Folders></m:GetFolderResponseMessage><m:GetFolderResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode><m:Folders><t:Folder><t:FolderId Id=\"AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAAabzXAAA=\" ChangeKey=\"AQAAABYAAADVV7DQctuIRYeYB4MK+03/AAHF4mdI\"/></t:Folder></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"
log_ews_resource_proto: data KIO::TransferJob(0x55bfb66ffa60) "></s:Body></s:Envelope>"
log_ews_resource_proto: data KIO::TransferJob(0x55bfb66ffa60) ""
log_ews_resource_proto: response dumped to "/tmp/akonadi-ews-X68gxoc/ews_xmldump_ik27678.xml"
log_ews_resource_request: Got GetFolder response (id: 160pjxo, name: )
log_ews_resource_request: Got GetFolder response (id: dbmt72, name: )
log_ews_resource_request: Got GetFolder response (id: 1o0lurm, name: )
log_ews_resource_request: Got GetFolder response (id: 1xqdb6z, name: )
log_ews_resource_request: Got GetFolder response (id: gdbqv2, name: )
log_ews_resource_request: Got GetFolder response (id: 1v0xrcc, name: )
log_ews_resource_request: Got GetFolder response - The specified object was not found in the store., The process failed to get the correct properties.
log_ews_resource_request: Got GetFolder response (id: 1nid2l5, name: )
log_ews_resource_request: Got GetFolder response (id: 1cr4zlc, name: )
log_ews_resource_request: Got GetFolder response (id: 1ur3xts, name: )
log_ews_resource_request: Got GetFolder response (id: 1qnanbk, name: )
log_ews_resource_request: Got GetFolder response (id: 1qdvdtm, name: )
log_ews_resource_request: Got GetFolder response (id: 1xrcqqk, name: )
log_ews_resource_request: Got GetFolder response (id: qswzuo, name: )
log_ews_resource_request: Got GetFolder response (id: ns25zb, name: )
log_ews_resource_request: Got GetFolder response (id: zk6d82, name: )
log_ews_resource_request: Got GetFolder response (id: 1j79hfg, name: )
log_ews_resource_request: Got GetFolder response (id: 13e3hq2, name: )
log_ews_resource: Invalid folder AAMkAGU0NjRhMTNiLTcxNWItNDQ2YS05OGQ1LWY0N2QyOTE3ZGE0OAAuAAAAAABVndXjmYa2TJeya3R3NcK5AQDbPMzgbs3fSoYAI/xeTJ7HAAAq4K/5AAA= - skipping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant