Deprecate storageServiceKey in SyncMessage.Keys
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
);
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user