Skip to content

Check update instead of force download - #49

Open
jhen0409 wants to merge 10 commits into
MarshallOfSound:mainfrom
jhen0409:check-update
Open

Check update instead of force download#49
jhen0409 wants to merge 10 commits into
MarshallOfSound:mainfrom
jhen0409:check-update

Conversation

@jhen0409

Copy link
Copy Markdown
Contributor

Related to #28.

This was start work by SimulatedGREG's repo but no longer response. :\

@MarshallOfSound MarshallOfSound left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😄

Comment thread src/needUpdate.js Outdated
return resolve(false);
});
} else {
reject(`Failed to check current version of ${chromeStoreID}.`);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👍

@jhen0409 jhen0409 May 26, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/utils.js Outdated
.then((res) => {
let body = '';
res.on('data', (chunk) => { body += chunk; });
res.on('end', () => resolve(Object.assign(res, { body })));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Purely to avoid mutating what should be an isolated object can we change this to

Object.assign({}, res, { body })

@linegel

linegel commented Apr 9, 2020

Copy link
Copy Markdown

Hey, @MarshallOfSound do you need any help with the finalization of this PR?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants