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

fix default case for responseType in WireClient._fetchRequest #1151 #1152

Merged
merged 2 commits into from Jan 19, 2019

Conversation

4 participants
@iLiviu
Copy link
Contributor

iLiviu commented Jan 7, 2019

If no responseType property is present in options parameter to WireClient._fetchRequest,
the function defaults to document and throws an error. If responseType is undefined,
the function should treat the response as text. Also, if the response is treated as text,
the syntheticXhr.responseText property should be set to processedBody in order to not
break XHR compatibility.

fix default case for responseType in WireClient._fetchRequest #1151
If no responseType property is present in options parameter to WireClient._fetchRequest,
the function defaults to document and throws an error. If responseType is undefined,
the function should treat the response as text. Also, if the response is treated as text,
the syntheticXhr.responseText property should be set to processedBody in order to not
break XHR compatibility.

@skddc skddc requested review from DougReeder and remotestorage/core Jan 8, 2019

@DougReeder

This comment has been minimized.

Copy link
Contributor

DougReeder commented Jan 9, 2019

This code looks fine.

It would be nice to have the tests in dropbox-suite and googledrive-suite run for both XHR and fetch, as is done in wireclient-suite.

@silverbucket
Copy link
Member

silverbucket left a comment

Would approve with tests

@iLiviu

This comment has been minimized.

Copy link
Contributor Author

iLiviu commented Jan 9, 2019

i will try and refactor the dropbox-suite and googledrive-suite and include tests for fetch when i get some time

refactored dropbox and googledrive tests
refactored wireclient-suite, dropbox-suite and googledrive-suite to use common code for XHR and fetch() mocks, so now dropbox-suite and googledrive-suite will also test using fetch() beside XHR. 

fixed a test in dropbox-suite.

added a test for WireClient when responseType is not set
@skddc

This comment has been minimized.

Copy link
Member

skddc commented Jan 19, 2019

I can confirm that this fixes both Dropbox and GDrive when compared to 1.2.0. Code lgtm.

Good job, @iLiviu! 👏

Tests have been added.

@skddc skddc merged commit e903dd9 into remotestorage:master Jan 19, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@iLiviu iLiviu deleted the iLiviu:bugfix/1151-fetch_handle_text_responseType branch Jan 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment