Open marcoancona opened 3 years ago
Is this trying to load event from calendar?
Based on log can you export the item which has issues?
Also I see that it may be minified lib, can you exclude ews lib from being minified and test again?
We investigated further. It turns out that one event has an invalid character in the Body
field. The Body looks like the following:
<Body BodyType="Text">
Hi all,
↵
↵I need one more acceptance. The candidate$B!G(Bs profile opens.
</Body>
The problem appears to be with the sequence 
, which makes the parsing fail. For a reproducible example see: https://codesandbox.io/s/quirky-worker-brfng?file=/src/index.js
Note 1): this does not fail on a Node environment. I suspect that DOMParser
works differently than xmldom
.
Note 2): issue reproducible on any browser console: (new DOMParser()).parseFromString("<Body>Test </Body>", "text/xml")
which build you are using for browser?
We are using ews-javascript-api
0.10.3 (the latest). Or what version are you referring to?
Just to clarify: the problem seems really to be caused by invalid XML data coming from the Outlook server. It appears that xmldom
is more robust than the native DOMParser
of Chromium when parsing invalid XML.
This is what happens in Chrome:
When we use ews-javascript-api
, either xmldom
or DOMParser
is used to parse the response. Which one is used depends on the environment (https://github.com/gautamsi/ews-javascript-api/blob/378b7c45fd7518312fd22c27d3d254a0dc1876c0/src/js/ExtensionMethods.ts#L499).
We will temporarily patch the library to force it to use xmldom
even in the browser, unless you tell us that this is not a good idea.
Try patching for xmldom that should work
Hi @gautamsi, some (but not all) of our users report a crash while synchronizing their Office 365 account. We could not reproduce the issue with out test account, but our logs show the following error:
Running in debug mode, it looks like the parsing of an event is interrupted abruptly but I can't see the reason:
I understand that this is not very complete information but I was wondering if you any idea of where to look in order to debug this.
ews-javascript-api:
0.10.3