Skip to content

Commit

Permalink
SDA-4181 Check beta auto-update channel from ACP
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenmoussati committed Jul 10, 2023
1 parent 61805ae commit 4f40f34
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion config/Symphony.config
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@
},
"autoLaunchPath": "",
"userDataPath": "",
"chromeFlags": ""
"chromeFlags": "",
"betaAutoUpdateChannelEnabled": true
}
14 changes: 12 additions & 2 deletions src/app/auto-update-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
4 changes: 4 additions & 0 deletions src/app/config-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export interface IConfig {
startedAfterAutoUpdate?: boolean;
enableBrowserLogin?: boolean;
browserLoginAutoConnect?: boolean;
betaAutoUpdateChannelEnabled?: boolean;
}

export interface IGlobalConfig {
Expand Down Expand Up @@ -99,6 +100,7 @@ export interface IPodLevelEntitlements {
}

export interface IACPFeatureLevelEntitlements {
betaAutoUpdateChannelEnabled: boolean;
devToolsEnabled: boolean;
permissions: IPermission;
}
Expand Down Expand Up @@ -449,6 +451,8 @@ class Config {
autoLaunchPath: latestGlobalConfig.autoLaunchPath,
userDataPath: latestGlobalConfig.userDataPath,
customFlags: latestGlobalConfig.customFlags,
betaAutoUpdateChannelEnabled:
latestGlobalConfig.betaAutoUpdateChannelEnabled,
});
}

Expand Down

0 comments on commit 4f40f34

Please sign in to comment.