Skip to content

Commit

Permalink
feat: improve updater for tauri v2 & handle pre-release (#1204)
Browse files Browse the repository at this point in the history
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](https://v2.tauri.app/plugin/updater/#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

---------

Co-authored-by: brianp <[email protected]>
  • Loading branch information
mmrrnn and brianp authored Dec 10, 2024
1 parent f3e8a9e commit cce052b
Show file tree
Hide file tree
Showing 29 changed files with 658 additions and 150 deletions.
8 changes: 8 additions & 0 deletions public/locales/af/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "Pas Uitnodigingskode Toe",
"cancel": "Cancel",
"change-language": "Verander taal",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Abandon current wallet?",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?",
"connected-peers": "Gekoppelde Eweknieë",
Expand Down Expand Up @@ -83,6 +85,11 @@
},
"pool-mining": "Poel Mynbou",
"pool-mining-description": "Wanneer geaktiveer, sal u in \"n poel myn en by \"n groep mynwerkers aansluit.",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Randomx netwerk hashrate",
"refresh-versions": "Verfris weergawes",
"release-notes": {
Expand All @@ -108,6 +115,7 @@
"title": "Outomatiese begin by stelsel opstart"
},
"should-use-system-language": "Gebruik stelsel taal",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "Airdrop",
Expand Down
8 changes: 8 additions & 0 deletions public/locales/cn/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "应用邀请代码",
"cancel": "取消",
"change-language": "更改语言",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Abandon current wallet?",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?",
"connected-peers": "已连接的节点",
Expand Down Expand Up @@ -83,6 +85,11 @@
},
"pool-mining": "矿池挖矿",
"pool-mining-description": "启用后,您将在矿池中挖矿并加入一组矿工(部落)。",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Randomx 网络算力",
"refresh-versions": "刷新版本",
"release-notes": {
Expand All @@ -108,6 +115,7 @@
"title": "系统启动时自动启动"
},
"should-use-system-language": "使用系统语言",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "空投",
Expand Down
8 changes: 8 additions & 0 deletions public/locales/de/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "Einladungscode anwenden",
"cancel": "Abbrechen",
"change-language": "Sprache",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Abandon current wallet?",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?",
"connected-peers": "Verbundenen Peers",
Expand Down Expand Up @@ -83,6 +85,11 @@
},
"pool-mining": "Pool-Mining",
"pool-mining-description": "Wenn aktiviert, wirst du in einem Pool minen und einer Gruppe von Minern beitreten.",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Randomx-Netzwerk-Hashrate",
"refresh-versions": "Versionen aktualisieren",
"release-notes": {
Expand All @@ -108,6 +115,7 @@
"title": "Automatischer Start beim Systemstart"
},
"should-use-system-language": "Systemsprache verwenden",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "Airdrop",
Expand Down
8 changes: 8 additions & 0 deletions public/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "Apply Invite Code",
"cancel": "Cancel",
"change-language": "Language",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Import new wallet",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?\nYour current wallet will be abandoned.",
"connected-peers": "Connected Peers",
Expand Down Expand Up @@ -83,6 +85,11 @@
},
"pool-mining": "Pool Mining",
"pool-mining-description": "When enabled, you will mine in a pool and join a group of miners.",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Randomx network hashrate",
"refresh-versions": "Refresh versions",
"release-notes": {
Expand All @@ -108,6 +115,7 @@
"title": "Auto-start on system boot"
},
"should-use-system-language": "Use system language",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "Airdrop",
Expand Down
8 changes: 8 additions & 0 deletions public/locales/fr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "Appliquer le code d\"invitation",
"cancel": "Cancel",
"change-language": "Langue",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Abandon current wallet?",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?",
"connected-peers": "Pairs connectés",
Expand Down Expand Up @@ -83,6 +85,11 @@
},
"pool-mining": "Minage en pool",
"pool-mining-description": "Lorsqu\"il est activé, vous minerez dans un pool et rejoindrez un groupe de mineurs.",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Taux de hachage du réseau Randomx",
"refresh-versions": "Rafraîchir les versions",
"release-notes": {
Expand All @@ -108,6 +115,7 @@
"title": "Démarrage automatique au démarrage du système"
},
"should-use-system-language": "Utiliser la langue du système",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "Airdrop",
Expand Down
8 changes: 8 additions & 0 deletions public/locales/hi/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "आमंत्रण कोड लागू करें",
"cancel": "रद्द करें",
"change-language": "भाषा",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Abandon current wallet?",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?",
"connected-peers": "जुड़े हुए सहकर्मी",
Expand Down Expand Up @@ -83,6 +85,11 @@
},
"pool-mining": "पूल माइनिंग",
"pool-mining-description": "सक्षम होने पर, आप एक पूल में माइन करेंगे और माइनर्स के समूह में शामिल होंगे।",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Randomx नेटवर्क हैशरेट",
"refresh-versions": "संस्करण ताज़ा करें",
"release-notes": {
Expand All @@ -108,6 +115,7 @@
"title": "सिस्टम बूट पर स्वचालित शुरूआत"
},
"should-use-system-language": "सिस्टम भाषा का उपयोग करें",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "एयरड्रॉप",
Expand Down
8 changes: 8 additions & 0 deletions public/locales/id/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "Terapkan Kode Undangan",
"cancel": "Batal",
"change-language": "Bahasa",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Abandon current wallet?",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?",
"connected-peers": "Rekan Terhubung",
Expand Down Expand Up @@ -83,6 +85,11 @@
},
"pool-mining": "Penambangan Pool",
"pool-mining-description": "Ketika diaktifkan, Anda akan menambang dalam pool dan bergabung dengan kelompok penambang.",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Hashrate jaringan Randomx",
"refresh-versions": "Segarkan versi",
"release-notes": {
Expand All @@ -108,6 +115,7 @@
"title": "Mulai otomatis saat boot sistem"
},
"should-use-system-language": "Gunakan bahasa sistem",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "Airdrop",
Expand Down
8 changes: 8 additions & 0 deletions public/locales/ja/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "招待コードを適用",
"cancel": "キャンセル",
"change-language": "言語",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Abandon current wallet?",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?",
"connected-peers": "接続されたピア",
Expand Down Expand Up @@ -83,6 +85,11 @@
},
"pool-mining": "プールマイニング",
"pool-mining-description": "有効にすると、プールでマイニングし、マイナーのグループに参加します。",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Randomxネットワークのハッシュレート",
"refresh-versions": "バージョンを更新",
"release-notes": {
Expand All @@ -108,6 +115,7 @@
"title": "システム起動時に自動開始"
},
"should-use-system-language": "システム言語を使用",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "エアドロップ",
Expand Down
8 changes: 8 additions & 0 deletions public/locales/ko/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "초대 코드 적용",
"cancel": "취소",
"change-language": "언어",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Abandon current wallet?",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?",
"connected-peers": "연결된 피어",
Expand Down Expand Up @@ -83,6 +85,11 @@
},
"pool-mining": "풀 채굴",
"pool-mining-description": "활성화되면 풀에서 채굴하고 마이너 그룹에 참여합니다.",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Randomx 네트워크 해시레이트",
"refresh-versions": "버전 새로고침",
"release-notes": {
Expand All @@ -108,6 +115,7 @@
"title": "시스템 부팅 시 자동 시작"
},
"should-use-system-language": "시스템 언어 사용",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "에어드롭",
Expand Down
8 changes: 8 additions & 0 deletions public/locales/pl/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "Zastosuj Kod Zaproszenia",
"cancel": "Anuluj",
"change-language": "Zmień język",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Abandon current wallet?",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?",
"connected-peers": "Połączone węzły",
Expand Down Expand Up @@ -85,6 +87,11 @@
},
"pool-mining": "Kopanie w puli",
"pool-mining-description": "Po włączeniu tej opcji będziesz wydobywać w puli i dołączać do grupy górników (plemienia).",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Hashrate sieci Randomx",
"refresh-versions": "Odśwież wersje",
"release-notes": {
Expand All @@ -110,6 +117,7 @@
"title": "Automatyczne uruchamianie przy starcie systemu"
},
"should-use-system-language": "Użyj języka systemowego",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "Airdrop",
Expand Down
8 changes: 8 additions & 0 deletions public/locales/ru/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "Применить код приглашения",
"cancel": "Отмена",
"change-language": "Язык",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Abandon current wallet?",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?",
"connected-peers": "Подключенные узлы",
Expand Down Expand Up @@ -83,6 +85,11 @@
},
"pool-mining": "Майнинг в пуле",
"pool-mining-description": "При включении вы будете майнить в пуле и присоединитесь к группе майнеров.",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Хэшрейт сети Randomx",
"refresh-versions": "Обновить версии",
"release-notes": {
Expand All @@ -108,6 +115,7 @@
"title": "Автозапуск при загрузке системы"
},
"should-use-system-language": "Использовать системный язык",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "Эйрдроп",
Expand Down
8 changes: 8 additions & 0 deletions public/locales/tr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"applyInviteCode": "Davet Kodunu Uygula",
"cancel": "İptal",
"change-language": "Dil Değiştir",
"confirm": "Confirm",
"confirm-action": "Confirm action",
"confirm-import-wallet": "Abandon current wallet?",
"confirm-import-wallet-copy": "Are you sure you want to import a new wallet?",
"connected-peers": "Bağlı Eşler",
Expand Down Expand Up @@ -83,6 +85,11 @@
},
"pool-mining": "Havuz Madenciliği",
"pool-mining-description": "Etkinleştirildiğinde, bir havuzda madencilik yapacak ve bir grup madenciye (kabileye) katılacaksınız.",
"pre-release": {
"description": "Explore the latest features before they go live and provide feedback",
"title": "Use pre-release version"
},
"pre-release-note": "You are about to switch to the pre-release version of the application. This version can offer exciting new features and enhancements, with the possibility of encountering areas that may still be under refinement.",
"randomx-network-hash-rate": "Randomx ağ hash oranı",
"refresh-versions": "Sürümleri yenileyin",
"release-notes": {
Expand All @@ -108,6 +115,7 @@
"title": "Sistem açılışında otomatik başlat"
},
"should-use-system-language": "Sistem Dilini Kullan",
"stable-version-note": "By turning off the pre-release version of the application, you will revert to the stable release, which prioritizes reliability and consistency. While you may miss out on the latest features and enhancements.",
"stats-server-port": "Stats server port",
"tabs": {
"airdrop": "Airdrop",
Expand Down
Loading

0 comments on commit cce052b

Please sign in to comment.