Check update instead of force download#49
Check update instead of force download#49jhen0409 wants to merge 10 commits intoMarshallOfSound:mainfrom
Conversation
MarshallOfSound
left a comment
There was a problem hiding this comment.
Sorry it took so long to get to this, it looks OK just two small comments.
Note to self, this will be a breaking change when released 😄
src/needUpdate.js
Outdated
| return resolve(false); | ||
| }); | ||
| } else { | ||
| reject(`Failed to check current version of ${chromeStoreID}.`); |
There was a problem hiding this comment.
Maybe we should log something and resolve(true) just in case? Rejecting this promise will simply mess with developers, we can try to help them out as much as possible 👍
There was a problem hiding this comment.
I checked the API again, it should always response status 200 if there is no any network errors, so I just remove the line, and log message if response app.status is error-invalidAppId.
src/utils.js
Outdated
| .then((res) => { | ||
| let body = ''; | ||
| res.on('data', (chunk) => { body += chunk; }); | ||
| res.on('end', () => resolve(Object.assign(res, { body }))); |
There was a problem hiding this comment.
Purely to avoid mutating what should be an isolated object can we change this to
Object.assign({}, res, { body })|
Hey, @MarshallOfSound do you need any help with the finalization of this PR? |
Related to #28.
This was start work by SimulatedGREG's repo but no longer response. :\