From 4f40f345648340716d9bc2031696787736e84f54 Mon Sep 17 00:00:00 2001 From: sbenmoussati <51402489+sbenmoussati@users.noreply.github.com> Date: Thu, 8 Jun 2023 11:57:00 +0200 Subject: [PATCH] SDA-4181 Check beta auto-update channel from ACP --- config/Symphony.config | 3 ++- src/app/auto-update-handler.ts | 14 ++++++++++++-- src/app/config-handler.ts | 4 ++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/config/Symphony.config b/config/Symphony.config index e2f612deb..c13d01eaf 100644 --- a/config/Symphony.config +++ b/config/Symphony.config @@ -42,5 +42,6 @@ }, "autoLaunchPath": "", "userDataPath": "", - "chromeFlags": "" + "chromeFlags": "", + "betaAutoUpdateChannelEnabled": true } diff --git a/src/app/auto-update-handler.ts b/src/app/auto-update-handler.ts index fcdd8181e..efdb4d663 100644 --- a/src/app/auto-update-handler.ts +++ b/src/app/auto-update-handler.ts @@ -222,11 +222,21 @@ export class AutoUpdate { }; private getGenericServerOptions = (): GenericServerOptions => { - const { autoUpdateChannel } = config.getConfigFields(['autoUpdateChannel']); + let userAutoUpdateChannel; + const { autoUpdateChannel, betaAutoUpdateChannelEnabled } = + config.getConfigFields([ + 'autoUpdateChannel', + 'betaAutoUpdateChannelEnabled', + ]); + userAutoUpdateChannel = betaAutoUpdateChannelEnabled + ? 'beta' + : autoUpdateChannel; + logger.info(`auto-update-handler: using channel ${userAutoUpdateChannel}`); + const opts: GenericServerOptions = { provider: 'generic', url: this.getUpdateUrl(), - channel: autoUpdateChannel || null, + channel: userAutoUpdateChannel || null, }; return opts; }; diff --git a/src/app/config-handler.ts b/src/app/config-handler.ts index ead544370..4be23aae7 100644 --- a/src/app/config-handler.ts +++ b/src/app/config-handler.ts @@ -60,6 +60,7 @@ export interface IConfig { startedAfterAutoUpdate?: boolean; enableBrowserLogin?: boolean; browserLoginAutoConnect?: boolean; + betaAutoUpdateChannelEnabled?: boolean; } export interface IGlobalConfig { @@ -99,6 +100,7 @@ export interface IPodLevelEntitlements { } export interface IACPFeatureLevelEntitlements { + betaAutoUpdateChannelEnabled: boolean; devToolsEnabled: boolean; permissions: IPermission; } @@ -449,6 +451,8 @@ class Config { autoLaunchPath: latestGlobalConfig.autoLaunchPath, userDataPath: latestGlobalConfig.userDataPath, customFlags: latestGlobalConfig.customFlags, + betaAutoUpdateChannelEnabled: + latestGlobalConfig.betaAutoUpdateChannelEnabled, }); }