From 8892e319df35c99183c2fabb15fb93109dc98350 Mon Sep 17 00:00:00 2001 From: yougotwill Date: Thu, 6 Mar 2025 09:43:05 +1100 Subject: [PATCH] feat: default to latest release channel if we dont have it set --- ts/components/dialog/debug/ReleaseChannel.tsx | 7 ++----- ts/mains/main_renderer.tsx | 2 +- ts/session/apis/file_server_api/FileServerApi.ts | 8 +++++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ts/components/dialog/debug/ReleaseChannel.tsx b/ts/components/dialog/debug/ReleaseChannel.tsx index 7d8848a1d..62e70f1f2 100644 --- a/ts/components/dialog/debug/ReleaseChannel.tsx +++ b/ts/components/dialog/debug/ReleaseChannel.tsx @@ -33,11 +33,8 @@ export const ReleaseChannel = () => { const changeReleaseChannel = (channel: ReleaseChannels) => { window.log.debug( - `WIP: [debugMenu] release channel to ${channel} was ${Storage.get('releaseChannel') || 'not set'}` + `WIP: [debugMenu] Setting release channel to ${channel}. It was ${Storage.get('releaseChannel') || 'not set'}` ); - if (Storage.get('releaseChannel') === channel) { - return; - } dispatch( updateConfirmModal({ title: localize('warning').toString(), @@ -49,7 +46,7 @@ export const ReleaseChannel = () => { await Storage.put('releaseChannel', channel); } catch (error) { window.log.warn( - `[debugMenu] Something went wrong when changing the release channel to ${channel} was ${Storage.get('releaseChannel') || 'not set'}:`, + `[debugMenu] Something went wrong when setting the release channel to ${channel}. It was ${Storage.get('releaseChannel') || 'not set'}:`, error && error.stack ? error.stack : error ); } finally { diff --git a/ts/mains/main_renderer.tsx b/ts/mains/main_renderer.tsx index badfd7d52..33f9f71c4 100644 --- a/ts/mains/main_renderer.tsx +++ b/ts/mains/main_renderer.tsx @@ -203,7 +203,7 @@ Storage.onready(async () => { await Storage.put('version', currentVersion); if (newVersion) { - window.log.info(`New version detected: ${currentVersion}; previous: ${lastVersion}`); + window.log.info(`[updater] New version detected: ${currentVersion}; previous: ${lastVersion}`); await Data.cleanupOrphanedAttachments(); } diff --git a/ts/session/apis/file_server_api/FileServerApi.ts b/ts/session/apis/file_server_api/FileServerApi.ts index d1adf73ab..bcdad21c6 100644 --- a/ts/session/apis/file_server_api/FileServerApi.ts +++ b/ts/session/apis/file_server_api/FileServerApi.ts @@ -141,7 +141,13 @@ export const getLatestReleaseFromFileServer = async ( ed25519SecretKey: userEd25519SecretKey, }); const method = 'GET'; - const releaseChannel = Storage.get('releaseChannel') as ReleaseChannels; + let releaseChannel = Storage.get('releaseChannel') as ReleaseChannels; + + if (!releaseChannel) { + releaseChannel = 'latest'; + await Storage.put('releaseChannel', releaseChannel); + } + const endpoint = `${RELEASE_VERSION_ENDPOINT}?platform=desktop&os=${getOSPlatform()}&arch=${getOSArchitecture()}${releaseChannel ? `&release_channel=${releaseType || releaseChannel}` : ''}`; const signature = await BlindingActions.blindVersionSignRequest({