Skip to content
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

feat: check for new releases (ActivityWatch/activitywatch#114) #225

Merged
merged 4 commits into from
Aug 22, 2020

Conversation

billangli
Copy link
Contributor

@billangli billangli commented Aug 15, 2020

Web UI Changes

I added the following alerts to the top of the webpages. The following shows if there is a new update.
Screenshot from 2020-08-15 13-51-00
After clicking disable, the follow up tells the user that they can re-enable the check.
Screenshot from 2020-08-15 13-51-24
The following is where you can change the settings.
Screenshot from 2020-08-15 18-34-09
All of the above components will not be rendered if the web app is built using npm run build -- --os=android instead of just npm run build. See ActivityWatch/aw-android#50.

When does it check?

Let's define checking by getting the release versions from the /info endpoint and the GitHub API and displying the notification if there is a different version.

Every time the web app is loaded (e.g. on a refresh or close and then reopen tab), it will perform check if the backoff period ends. The backoff period is usually 1 day. After 5 consecutive notifications reminding the user to download the update, it will change the backoff period to 5 days.

Notes

  • Future release tag names should follow the Semantic Versioning Specification, for example, v0.8.0b9 should be changed to v0.8.0-beta.9, because this component uses the semver package
  • I also moved src/util/classes.test.js → test/unit/classes.test.node.js to fit in with the rest of the tests, it runs sucessfully
  • screenshot.test.js is ignored when running npm test (because it wasn't run before, but now it's getting picked up by my changes in jest.config.js)

Fixes ActivityWatch/activitywatch#114

@billangli billangli force-pushed the dev/check-for-new-releases branch from b5fe7df to 81a6985 Compare August 16, 2020 00:29
Copy link
Member

@ErikBjare ErikBjare left a comment

Choose a reason for hiding this comment

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

Very nice work!

I haven't reviewed super carefully but overall very happy with the changes :)

@billangli
Copy link
Contributor Author

Great! Thanks for the words of encouragement, I'll make the changes soon 👍

Copy link
Member

@ErikBjare ErikBjare left a comment

Choose a reason for hiding this comment

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

One question regarding the jest config, but I'm overall very happy with these changes, so I'll go ahead and merge :)

displayName: 'node',
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/test/**/*.test.node.js?(x)'],
Copy link
Member

Choose a reason for hiding this comment

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

Will this work for tests written in TypeScript?

@ErikBjare ErikBjare merged commit 707c45a into ActivityWatch:master Aug 22, 2020
@ErikBjare
Copy link
Member

ErikBjare commented Aug 22, 2020

Thanks a lot for the contribution! 🎉

This is a huge improvement. Making sure ActivityWatch is kept up-to-date is important for so many reasons (just to pick a few: no bug reports for old versions, improved user retention/engagement, a step towards becoming "evergreen" software).

@billangli
Copy link
Contributor Author

Thanks @ErikBjare! I am glad to help with this useful project. If you have any coding-related work that needs help with, feel free to let me know. I'd be happy to try my hand on it.

I've looked at the rest of the issues in the to-do list of Road to 1.0 and these three seem like they haven't been visited in a while:

If you don't need a hand with these I can always dig up other issues to work on.

@ErikBjare
Copy link
Member

@billangli Missed your comment, sorry! #151 looks a bit messy/unclear, but would love to see you work on the others!

@billangli
Copy link
Contributor Author

@ErikBjare great! Thanks for letting me know

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.

Versioning and checking for updates
3 participants