This repository has been archived by the owner. It is now read-only.

Clear status bar icon if current version is newer than cached update #75

Merged
merged 1 commit into from Apr 30, 2018

Conversation

Projects
None yet
1 participant
@50Wliu
Member

50Wliu commented Apr 30, 2018

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Previously, if an update was found, that version would be stored in local storage and the squirrel icon would be displayed until the current Atom version matched the version in local storage. Of course, this does not work if the version that Atom is updated to is newer than the one that LocalStorage knows about. This can happen, for example, when switching from stable to beta. In that case, About would still insist that there was an update available.

To solve this issue, I have included the semver npm package for version checking. The update state is now cleared if the current Atom version is greater than or equal to the version in LocalStorage. Similarly, an update is only available if the current Atom version is less than the version in LocalStorage.

New tests have been verified to fail when old behavior is maintained.

Alternate Designs

Manual string comparisons could be done without bringing in the semver dependency.

Benefits

People who install new versions before the updater realizes they're available will not have a Squirrel icon stuck in their status bar.

Possible Drawbacks

Slightly longer startup time.

Applicable Issues

Fixes #50

@50Wliu 50Wliu merged commit e39cdf9 into master Apr 30, 2018

2 checks passed

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

@50Wliu 50Wliu deleted the wl-clear-if-newer branch Apr 30, 2018

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