Page MenuHomePhabricator

D8120.id27762.diff
No OneTemporary

D8120.id27762.diff

diff --git a/web/database/database-module-provider.js b/web/database/database-module-provider.js
--- a/web/database/database-module-provider.js
+++ b/web/database/database-module-provider.js
@@ -41,7 +41,7 @@
}
}
- init() {
+ init(encryptionKey?: ?SubtleCrypto$JsonWebKey) {
this.status = databaseStatuses.initInProgress;
this.worker = new SharedWorker(DATABASE_WORKER_PATH);
this.worker.onerror = console.error;
@@ -58,6 +58,7 @@
type: workerRequestMessageTypes.INIT,
sqljsFilePath: `${origin}${SQLJS_FILE_PATH}`,
sqljsFilename,
+ encryptionKey,
});
this.status = databaseStatuses.initSuccess;
console.info('Database initialization success');
@@ -68,7 +69,10 @@
})();
}
- initDBForLoggedInUser(currentLoggedInUserID: ?string) {
+ initDBForLoggedInUser(
+ currentLoggedInUserID: ?string,
+ encryptionKey?: ?SubtleCrypto$JsonWebKey,
+ ) {
if (this.status === databaseStatuses.initSuccess) {
return;
}
@@ -77,7 +81,7 @@
this.status === databaseStatuses.notSupported &&
isSQLiteSupported(currentLoggedInUserID)
) {
- this.init();
+ this.init(encryptionKey);
}
}
diff --git a/web/types/worker-types.js b/web/types/worker-types.js
--- a/web/types/worker-types.js
+++ b/web/types/worker-types.js
@@ -36,6 +36,7 @@
+type: 1,
+sqljsFilePath: string,
+sqljsFilename: ?string,
+ +encryptionKey?: ?SubtleCrypto$JsonWebKey,
};
export type GenerateDatabaseEncryptionKeyRequestMessage = {

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 10:54 AM (21 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574629
Default Alt Text
D8120.id27762.diff (1 KB)

Event Timeline