@@ -45,9 +45,13 @@ interface IState {
45
45
error ?: boolean ;
46
46
}
47
47
48
- /*
49
- * Walks the user through the process of creating an e2e key backup
50
- * on the server.
48
+ /**
49
+ * Walks the user through the process of setting up e2e key backups to a new backup, and storing the decryption key in
50
+ * SSSS.
51
+ *
52
+ * Uses {@link accessSecretStorage}, which means that if 4S is not already configured, it will be bootstrapped (which
53
+ * involves displaying an {@link CreateSecretStorageDialog} so the user can enter a passphrase and/or download the 4S
54
+ * key).
51
55
*/
52
56
export default class CreateKeyBackupDialog extends React . PureComponent < IProps , IState > {
53
57
public constructor ( props : IProps ) {
@@ -75,6 +79,14 @@ export default class CreateKeyBackupDialog extends React.PureComponent<IProps, I
75
79
const cli = MatrixClientPeg . safeGet ( ) ;
76
80
try {
77
81
await accessSecretStorage ( async ( ) : Promise < void > => {
82
+ // `accessSecretStorage` will have bootstrapped secret storage if necessary, so we can now
83
+ // set up key backup.
84
+ //
85
+ // XXX: `bootstrapSecretStorage` also sets up key backup as a side effect, so there is a 90% chance
86
+ // this is actually redundant.
87
+ //
88
+ // The only time it would *not* be redundant would be if, for some reason, we had working 4S but no
89
+ // working key backup. (For example, if the user clicked "Delete Backup".)
78
90
info = await cli . prepareKeyBackupVersion ( null /* random key */ , {
79
91
secureSecretStorage : true ,
80
92
} ) ;
0 commit comments