Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

0.10.9 #480

Closed
wants to merge 5 commits into from
Closed

0.10.9 #480

wants to merge 5 commits into from

Conversation

gd1990
Copy link

@gd1990 gd1990 commented Aug 14, 2017

No description provided.

* bump to 0.10.8

* Update PULL_REQUEST_TEMPLATE

* Fix #468 "Messy error returns: Sometimes a string, sometimes an Error object"

* Cleanup: remove an unused constant and duplicate method definitions

* Cleanup:
- fix minor errors in JSDoc comments, for example {string]} => {string}
- fix parameter name "encode" => "encoding" (more logical, and it says so in the function's JSDoc too)
- json-stream.js: split a looooong log message string constant into two parts and fix a typo ("maually"), and the type for objects is "Object" (capitalized) in Flow type annotations

* Fix a (Flow) type conflict - fixes issue #461

* NEEDS REVIEW - Attempt to fix some of issue #460 (Error message normalization)

Error messages reported by iOS and Android versions should be as similar as possible. Also, within the same system there should be consistency. This patch is an attempt to bring a LITTLE more of this consistency to the error messages. I also fixed some very few minor language issues, like "does not exist" (is the correct English). I tried keeping the changes to a minimum.

Background: In my project code I want to know when a file already exists (e.g. after calling fs.createFile), and the only way is to check the error message string that I get. It's bad if they differ between versions (createFileASCII and createFile) and then also between Android and iOS version. At least some core part of the string should be the same, so that I have something to match.

Ideally messages should come from a centralized easy (easier) to maintain file (for both iOS and Android), and ideally both systems should have the same errors and messages as far as possible.
* bump to 0.10.8

* Update PULL_REQUEST_TEMPLATE

* Fix #468 "Messy error returns: Sometimes a string, sometimes an Error object"

* Cleanup: remove an unused constant and duplicate method definitions

* Cleanup:
- fix minor errors in JSDoc comments, for example {string]} => {string}
- fix parameter name "encode" => "encoding" (more logical, and it says so in the function's JSDoc too)
- json-stream.js: split a looooong log message string constant into two parts and fix a typo ("maually"), and the type for objects is "Object" (capitalized) in Flow type annotations

* Fix a (Flow) type conflict - fixes issue #461

* NEEDS REVIEW - Attempt to fix some of issue #460 (Error message normalization)

Error messages reported by iOS and Android versions should be as similar as possible. Also, within the same system there should be consistency. This patch is an attempt to bring a LITTLE more of this consistency to the error messages. I also fixed some very few minor language issues, like "does not exist" (is the correct English). I tried keeping the changes to a minimum.

Background: In my project code I want to know when a file already exists (e.g. after calling fs.createFile), and the only way is to check the error message string that I get. It's bad if they differ between versions (createFileASCII and createFile) and then also between Android and iOS version. At least some core part of the string should be the same, so that I have something to match.

Ideally messages should come from a centralized easy (easier) to maintain file (for both iOS and Android), and ideally both systems should have the same errors and messages as far as possible.

* Fixes #467 by improving the write() function of write streams: By resolving with the RNFetchBlobWriteStream instance instead of with "undefined" writes can now be chained:

RNFetchBlob.fs.writeStream(PATH_TO_FILE, 'utf8', true)
.then((ofstream) => ofstream.write('foo'))
.then((ofstream) => ofstream.write('bar'))
.then((ofstream) => ofstream.write('foobar'))
.then((ofstream) => ofstream.close())

Reference: #467 (comment)
* bump to 0.10.8

* Update PULL_REQUEST_TEMPLATE

* Forgot to normalize the error message of readFile
@lll000111
Copy link
Contributor

lll000111 commented Aug 14, 2017

I think you should wait before you merge this to master (well, depending on what master is used for), I have a few more changes, and the commit for the new fs.hash function is missing an import statement on iOS. My own tiny tests of my other changes work but I cannot get the tests to run: wkh237/react-native-fetch-blob-dev#1 EDIT: I ran the tests and they all pass. I'll do a few more updates and then try to create a PR - I have more trouble with git than with the code...

Once this is done I'll submit another PR.

@wkh237
Copy link
Owner

wkh237 commented Aug 16, 2017

Not sure what does this PR exactly for ? We only merge the branches back to master before we publish new version.

@wkh237 wkh237 closed this Aug 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants