Linux: Detect changes in safeStorage backend
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
parent
233a18bc81
commit
16864e381a
4 changed files with 107 additions and 10 deletions
24
ts/types/SafeStorageBackendChangeError.ts
Normal file
24
ts/types/SafeStorageBackendChangeError.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export class SafeStorageBackendChangeError extends Error {
|
||||
override name = 'SafeStorageBackendChangeError';
|
||||
|
||||
public readonly currentBackend: string;
|
||||
public readonly previousBackend: string;
|
||||
|
||||
constructor({
|
||||
currentBackend,
|
||||
previousBackend,
|
||||
}: {
|
||||
currentBackend: string;
|
||||
previousBackend: string;
|
||||
}) {
|
||||
super(
|
||||
`Detected change in safeStorage backend, can't decrypt DB key (previous: ${previousBackend}, current: ${currentBackend})`
|
||||
);
|
||||
|
||||
this.currentBackend = currentBackend;
|
||||
this.previousBackend = previousBackend;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue