Add a remote config option to disable libsignal transport in prod

This commit is contained in:
Sergey Skrobotov 2024-04-18 11:46:48 -07:00 committed by GitHub
parent d31a4d5d91
commit df1240049a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -27,6 +27,7 @@ export type ConfigKeyType =
| 'desktop.senderKeyMaxAge' | 'desktop.senderKeyMaxAge'
| 'desktop.experimentalTransportEnabled.alpha' | 'desktop.experimentalTransportEnabled.alpha'
| 'desktop.experimentalTransportEnabled.beta' | 'desktop.experimentalTransportEnabled.beta'
| 'desktop.experimentalTransportEnabled.prod'
| 'desktop.cdsiViaLibsignal' | 'desktop.cdsiViaLibsignal'
| 'global.attachments.maxBytes' | 'global.attachments.maxBytes'
| 'global.attachments.maxReceiveBytes' | 'global.attachments.maxReceiveBytes'

View file

@ -559,8 +559,14 @@ export class SocketManager extends EventListener {
: TransportOption.ShadowingLow; : TransportOption.ShadowingLow;
} }
// in prod, using original // in prod, switch to using 'ShadowingHigh' mode, unless user opts out,
return TransportOption.ShadowingLow; // in which case switching to `ShadowingLow`
const configValue = window.Signal.RemoteConfig.isEnabled(
'desktop.experimentalTransportEnabled.prod'
);
return configValue
? TransportOption.ShadowingLow
: TransportOption.Original;
} }
private connectLibsignalUnauthenticated(): AbortableProcess<IWebSocketResource> { private connectLibsignalUnauthenticated(): AbortableProcess<IWebSocketResource> {