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

Show banner to upgrade to latest version when ArchiveBox is out of date #696

Open
pirate opened this issue Apr 8, 2021 · 2 comments
Open
Labels
good first ticket size: easy status: backlog Work is planned someday but is not the highest priority at the moment touches: js Pull requests that update Javascript code
Milestone

Comments

@pirate
Copy link
Member

pirate commented Apr 8, 2021

Many people seem to be running older versions, which can lead to trouble when upgrading many versions at a time.

I'd like to nudge people towards upgrading more frequently by showing something in the UI.

Possibly using: https://github.com/releasepage/version.js

Conditions:

  • If user is logged in
  • If user is_superuser
  • If there is a newer stable ArchiveBox version available from Github.com/ArchiveBox/ArchiveBox
  • If user has not hidden this popup before on this device

Then:

  • Show a small popup/banner somewhere in the Web UI indicating a new version of ArchiveBox is available
  • Show the currently installed version number (linked to Github releases URL), the new version available (linked to github releases URL)
  • Limit next version available to += 1 major version at a time, e.g. if user is on 0.7.0 go to last minor version 0.7.9, then +=1 1 major version at a time to 0.8.9, then finally 0.9.3 latest version
  • link to instructions upgrading, changelog, and roadmap pages in the Docs
  • also at the end of archivebox add/schedule jobs, show hint line in CLI stderr output if upgrade is available
@pirate pirate added size: easy good first ticket status: backlog Work is planned someday but is not the highest priority at the moment is: enhancement touches: js Pull requests that update Javascript code labels Apr 8, 2021
@pirate pirate added this to the v0.6.3 milestone Apr 16, 2021
@pirate pirate changed the title Show prompt to update in Web UI when ArchiveBox version is out of date Show prompt to upgrade to latest version when ArchiveBox is out of date Oct 24, 2023
@pirate pirate changed the title Show prompt to upgrade to latest version when ArchiveBox is out of date Show banner to upgrade to latest version when ArchiveBox is out of date Oct 24, 2023
@benmuth
Copy link
Contributor

benmuth commented Nov 26, 2023

@pirate Couple of questions about the implementation for this:

  • Should the majority of the logic be implemented in JS or Python? I've gotten something mostly working in JS, but I still have to implement the CLI hint which will require some Python modifications anyway.
  • Should we cache the results of the GH releases API call for performance, or is that not important right now? I'm guessing the best way to do that would be to add or modify a Model?

@pirate
Copy link
Member Author

pirate commented Nov 26, 2023

Ah just saw this, so unfortunately it has to be in Python not JS, because we need to show the warning in the CLI too, and I don't want every page request to phone home to GitHub so we'd want to do it once on startup of the server and just store it as a global config variable.

No need to store the result on disk or in a model, just check once in config.py and set the result in a variable e.g. LATEST_VERSION = "0.8.9". Then if LATEST_VERSION > VERSION show the CLI warning and a UI banner.

The hiding banner logic can be in JS (if user has hidden the banner, then store a var in their browser's localstorage to not show the banner again).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first ticket size: easy status: backlog Work is planned someday but is not the highest priority at the moment touches: js Pull requests that update Javascript code
Projects
None yet
Development

No branches or pull requests

2 participants