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] in-app update check #373

Open
opxdelwin opened this issue Mar 31, 2024 · 9 comments
Open

[feat] in-app update check #373

opxdelwin opened this issue Mar 31, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@opxdelwin
Copy link
Contributor

opxdelwin commented Mar 31, 2024

Tell us about the task you want to perform and are unable to do so because the feature is not available
Implement feature to automate checking for app updates on launch as mentioned below.

Describe the solution/feature you'd like us to add
On launch, we can check if a new version of API Dash is available by matching it with GitHub repository. This can be done by

  • Maintaining a version file in the root directory
  • By using GitHub API to find latest release.

image

Then an user prompt can be made to notify user that a new version is available for download. User may have an option to download now, or skip this update.

  • If user skips,

    • Save this action in shared preferences and not alert user for current stable version update.
  • If user updates,

    • Scenario 1 (Automatic Update)
      • Use GitHub API to download latest artifact according to user's platform
      • Perform an update (Approach to be discussed)
    • Scenario 2 (Manual Update)

Any other feedback you would like to provide regarding the site
This feature isn't a priority but a good to have, and may be merged after GSoC contribution period to avoid any conflicts.

@opxdelwin opxdelwin added the enhancement New feature or request label Mar 31, 2024
@sathsarabandaraj
Copy link

sathsarabandaraj commented Apr 2, 2024

Hi, I'm Sathsara. New here... More than happy to contribute.

We can use a pkg like "updat" and it'll definitely simplify the update mechanism, but if we require a more customised approach, we can implement a solution to check for updates and handle the installation process accordingly.

For Windows environments, we can execute system-specific commands to update the application. For instance:

apidash-windows-x86_64.exe /SILENT or /VERYSILENT

Using /SILENT will display progress during the update, while /VERYSILENT will perform the update silently without any visible progress indicators. Additionally, this command will prompt the application to close any running instances before updating and show the windows UAC window asking permission.

Windows UAC
image

Closing Application
image

/SILENT Update progress indicator
image

In Debian-based Linux distributions, we can use the following command to install the update:

sudo dpkg -i apidash-linux-amd64.deb

However, it's important to note that in Linux, obtaining the user's password may be necessary for installation. On the upside, updating the application in Linux shouldn't require closing any running instances, the update can be performed in the background, and the new version will be applied upon the next launch of the application.

For run system commands we can use "process_run" pkg

I might need some input on macOS since I don't have a device that's compatible.

@opxdelwin
Copy link
Contributor Author

Your plan seems solid. We'll need to dig into the specifics for the macOS platform. It might be wise to hold off on this until after GSoC '24 wraps up to avoid potential conflicts with other contributors' code. Once we're past that, tackling the implementation for mobile and tablet platforms should be smoother sailing. There are handy packages available that can handle auto-updates from the respective app stores, making the process much more manageable.

@animator would love your take on this.

@Tanish2002
Copy link
Contributor

@sathsarabandaraj probably not a good idea to install the debian package, also since packages are installed using sudo perms, We'll need to implement a password input handler as well.

Better approach for linux would be to simply give a popup like discord does:
image

One the user clicks on the download button a browser window opens that simply downloads the .deb file, users can simply install it themselves.

@opxdelwin
Copy link
Contributor Author

Rather than taking in the password within API Dash, we can have a popup to let user know that they'll have to manually run the command, and show the command itself?

@Tanish2002
Copy link
Contributor

Usually, that isn't necessary since that is how they would've installed apidash in the first place.

Also in the future when we can finalize the packaging process we can simply create packages for the distro repositories, so we don't have to worry about linux updates.
The user can get the updates from their package manager. (We'll can still show the user a popup if the system hasn't been updated and user is using a stale package).

However, if we feel like it, we can add it. Though, The commands will increase with the number of distros we support.

@EswarPesala
Copy link

please add the labels here like Gssoc, level1

@ashitaprasad
Copy link
Member

@EswarPesala we will add it after assessing the effort made made in PR.

@mdex-geek
Copy link

@opxdelwin thanks for creating the issue i want to work on this type of feature I have same in my mind thanks for creating this
I try my best to make this this is first time on open source

@EswarPesala
Copy link

EswarPesala commented May 14, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants