-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fixing the XHR bug where the json is assumed to be a string in IE #4641
base: master
Are you sure you want to change the base?
Conversation
I'm concerned about the following comment by @AurelioDeRosa in the original issue about the proposed fix using
@JedWatson or @Noviny, would you mind weighing in on this issue? One note: I'm wondering if the RelationshipField.js and RelationshipFilter.js files need to be considered in this fix @jsundquist, as they also use I'm pasting this here for more visibility as it's a workaround, and is a copy of a comment by @AurelioDeRosa from issue #3734:
|
@jsundquist Is this fix also required for Microsoft Edge? Can you confirm the full build version of IE you are testing with (and Edge, if available)? Thanks, |
Testing was done within IE11 only, (11.0.9600.19002). Unfortunately I do not believe that I have access to Edge at this time. Based on the comments above as well by @autoboxer referencing the research that @AurelioDeRosa did within issue keystonejs/keystone#3734 (comment) this may need a second look. |
May not be the most elegant, but I think implementing an interim revision of @AurelioDeRosa solution (though we definitely need to be validating the result of JSON.parse()) as a small utility function would be safest for now...
while one of the core developers makes a decision about replacing 'xhr' with 'fetch', 'axios' etc., which seem to handle this more gracefully. I'm happy to implement and submit a PR, but I can't say with any certainty that I'll find all the areas this is needed. |
However unlikely, all these cases could be an issue though...
Here's my edits, but I'm sure some other scenarios need to be handled
Or we can just leave all this type checking up to someone else...
|
Description of changes
Updates all XHR request that are trying to request json data to include the option of
json: true
. Without this option IE treats the responses as a string.Related issues (if any)
Fixes #3734
Testing
npm run test-all
ran successfully.