remote config for making CDSI lookups via libsignal

This commit is contained in:
Sergey Skrobotov 2024-03-27 15:56:43 -07:00 committed by GitHub
parent bcf12e20c4
commit cf02337d6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View file

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

View file

@ -359,7 +359,7 @@ export class WebSocketResourceWithShadowing implements IWebSocketResource {
private updateStats(name: string) {
const storedStats = AggregatedStats.loadOrCreateEmpty(name);
const updatedStats = AggregatedStats.add(storedStats, this.stats);
let updatedStats = AggregatedStats.add(storedStats, this.stats);
if (
this.shadowingWithReporting &&
AggregatedStats.shouldReportError(updatedStats) &&
@ -368,6 +368,11 @@ export class WebSocketResourceWithShadowing implements IWebSocketResource {
window.reduxActions.toast.showToast({
toastType: ToastType.TransportError,
});
log.warn(
`${this.logId}: experimental transport toast displayed, flushing transport statistics before resetting`,
updatedStats
);
updatedStats = AggregatedStats.createEmpty();
updatedStats.lastToastTimestamp = Date.now();
}
AggregatedStats.store(updatedStats, name);

View file

@ -43,5 +43,8 @@ export async function getServiceIdsForE164s(
e164s,
acisAndAccessKeys,
returnAcisWithoutUaks: false,
useLibsignal: window.Signal.RemoteConfig.isEnabled(
'desktop.cdsiViaLibsignal'
),
});
}