Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit a4b4a93

Browse files
authored
CryptoSetupExtensions: deprecate unused getDehydrationKeyCallback (#46)
As of matrix-org/matrix-react-sdk#12919, getDehydrationKeyCallback is unused
1 parent 42eea76 commit a4b4a93

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Diff for: src/lifecycles/CryptoSetupExtensions.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export interface ProvideCryptoSetupExtensions {
115115
createSecretStorageKey(): Uint8Array | null;
116116
catchAccessSecretStorageError(e: Error): void;
117117
setupEncryptionNeeded: (args: CryptoSetupArgs) => boolean;
118+
/** @deprecated This callback is no longer used by matrix-react-sdk */
118119
getDehydrationKeyCallback():
119120
| ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>)
120121
| null;
@@ -128,9 +129,14 @@ export abstract class CryptoSetupExtensionsBase implements ProvideCryptoSetupExt
128129
public abstract createSecretStorageKey(): Uint8Array | null;
129130
public abstract catchAccessSecretStorageError(e: Error): void;
130131
public abstract setupEncryptionNeeded(args: CryptoSetupArgs): boolean;
131-
public abstract getDehydrationKeyCallback():
132+
133+
/** `getDehydrationKeyCallback` is no longer used; we provide an empty impl for type compatibility. */
134+
public getDehydrationKeyCallback():
132135
| ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>)
133-
| null;
136+
| null {
137+
return null;
138+
}
139+
134140
public abstract SHOW_ENCRYPTION_SETUP_UI: boolean;
135141
}
136142

@@ -143,9 +149,8 @@ export interface CryptoSetupArgs {
143149
/**
144150
*
145151
* The default/empty crypto-extensions
146-
* Can (and will) be used if none of the modules has an implementaion of IProvideCryptoSetupExtensions
147-
*
148-
* */
152+
* Can (and will) be used if none of the modules has an implementation of {@link ProvideCryptoSetupExtensions}.
153+
*/
149154
export class DefaultCryptoSetupExtensions extends CryptoSetupExtensionsBase {
150155
public SHOW_ENCRYPTION_SETUP_UI = true;
151156

@@ -178,7 +183,6 @@ export class DefaultCryptoSetupExtensions extends CryptoSetupExtensionsBase {
178183
public getDehydrationKeyCallback():
179184
| ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>)
180185
| null {
181-
console.log("Default empty getDehydrationKeyCallback() => null");
182186
return null;
183187
}
184188
}

0 commit comments

Comments
 (0)