Deprecate storageServiceKey in SyncMessage.Keys

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
automated-signal
2023-10-16 13:18:04 -07:00
committed by GitHub
parent 32046c0d19
commit bda5a9c0be
8 changed files with 62 additions and 26 deletions

View File

@@ -3292,12 +3292,15 @@ export default class MessageReceiver
logUnexpectedUrgentValue(envelope, 'keySync');
if (!sync.storageService) {
if (!sync.storageService && !sync.master) {
return undefined;
}
const ev = new KeysEvent(
sync.storageService,
{
storageServiceKey: dropNull(sync.storageService),
masterKey: dropNull(sync.master),
},
this.removeFromCache.bind(this, envelope)
);

View File

@@ -355,12 +355,23 @@ export class FetchLatestEvent extends ConfirmableEvent {
}
}
export type KeysEventData = Readonly<{
storageServiceKey: Uint8Array | undefined;
masterKey: Uint8Array | undefined;
}>;
export class KeysEvent extends ConfirmableEvent {
public readonly storageServiceKey: Uint8Array | undefined;
public readonly masterKey: Uint8Array | undefined;
constructor(
public readonly storageServiceKey: Uint8Array,
{ storageServiceKey, masterKey }: KeysEventData,
confirm: ConfirmCallback
) {
super('keys', confirm);
this.storageServiceKey = storageServiceKey;
this.masterKey = masterKey;
}
}