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: improve updater for tauri v2 & handle pre-release #1204

Merged
merged 8 commits into from
Dec 10, 2024

Conversation

mmrrnn
Copy link
Collaborator

@mmrrnn mmrrnn commented Dec 6, 2024

Description

This pull request introduces support pre-release versions, placed in settings. It also contains creating UpdatesManager on the backend side, which is kinda refactor of the previous updater implementation for Tauri V1.

  • Added pre_release field to AppConfig, placed in "General Settings"
  • Moved updater logic to the backend, created UpdatesManager to handle all related logic and provide straightforward commands. It gives us more control over the updates flow and far more space for debugging.
  • Updater Dialog UI is not changed, it's just "dumb" and react to the events from rust. User shouldn't see any significant change

How it works

  • When the pre-release version is enabled, the application retrieves the latest versions from alpha-latest.json. Disabling this flag immediately updates the application to the non-pre-release version.

  • When the pre-release version is disabled, the application fetches the latest versions from latest.json. From the user's perspective, there should be no significant changes. Enabling this flag instantly updates the application to the pre-release version.

Motivation and Context

#518 - Since we upgraded Tauri to v2, we can now handle pre-release versions. We use Tauri Dynamic Update Server to achieve this. This required us to move updater logic to the backend.

What process can a PR reviewer use to test or verify this change?

Testable on development environment. Play with this by changing

  • tauri-conf.json version to set the "current" app version
  • latest.json version to set the latest non-pre-release version
  • alpha.json version to set the latest pre-release version

Toggle "pre_release" flag in the settings to switch between these app versions, turn on/off the auto_update flag and see how it affects the app. You can also update the app via "Release Notes" section

@mmrrnn mmrrnn changed the title Improve updater for tauri v2 chore: improve updater for tauri v2 & handle pre-release Dec 6, 2024
@mmrrnn mmrrnn marked this pull request as ready for review December 6, 2024 10:42
@brianp brianp force-pushed the improve_updater_for_tauri_v2 branch from 98595da to 1eb41b4 Compare December 9, 2024 13:13
Copy link
Collaborator

@brianp brianp left a comment

Choose a reason for hiding this comment

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

Looks good to me, and seems to be working well enough in development.

Functionality change
Right now the current implementation permits downgrades if the latest.json, or alpha-latest.json has a lower version. We do not want downgrades to happen in this case. As we sometimes utilize the ability to bump a version up, have users download it, and then set the version lower. To rollout to only a small amount of people.

Ideally the only time we should allow downgrade is if the user is turning off pre-release versions.

When toggling the pre-release, We should also alert the user that we're going to restart with their upgraded or downgraded version.

UX Change
Put the pre-release setting directly after the auto-update setting.

@mmrrnn
Copy link
Collaborator Author

mmrrnn commented Dec 10, 2024

  • enabled downgrade only when user switches off pre-release version
  • removed redundant check for update when setting up the app
  • moved pre-release toggle button right below the one for auto update

Screenshot from 2024-12-10 14-36-58

@mmrrnn
Copy link
Collaborator Author

mmrrnn commented Dec 10, 2024

To sum up: app will only allow to downgrade, when user manually switches off the pre-release mode

@brianp brianp force-pushed the improve_updater_for_tauri_v2 branch from 75a7a02 to 4f5dff9 Compare December 10, 2024 14:33
@brianp brianp changed the title chore: improve updater for tauri v2 & handle pre-release feature: improve updater for tauri v2 & handle pre-release Dec 10, 2024
@brianp brianp changed the title feature: improve updater for tauri v2 & handle pre-release feat: improve updater for tauri v2 & handle pre-release Dec 10, 2024
@mmrrnn
Copy link
Collaborator Author

mmrrnn commented Dec 10, 2024

Sorry for lags, cancelled twice and then confirmed:

Screencast.from.12-10-2024.05.09.45.PM.webm

@brianp brianp merged commit cce052b into tari-project:main Dec 10, 2024
8 checks passed
@Tas4tari
Copy link

Tested on Windows 11, app version 0.8.25. I see the pre-release toggle displayed below the auto update option & I was able to enable/disable the option:
Screenshot (514)
Disable pre-release version:
Screenshot (515)
Screenshot (516)

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