Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3374084
D10306.id35119.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10306.id35119.diff
View Options
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
@@ -47,37 +47,36 @@
return;
}
- if (clearDatabase && this.status.type === databaseStatuses.initSuccess) {
- console.info('Clearing sensitive data');
- invariant(this.workerProxy, 'Worker proxy should exist');
- await this.workerProxy.scheduleOnWorker({
- type: workerRequestMessageTypes.CLEAR_SENSITIVE_DATA,
- });
- this.status = { type: databaseStatuses.notRunning };
- }
-
if (this.status.type === databaseStatuses.initInProgress) {
await this.status.initPromise;
return;
}
if (
- this.status.type === databaseStatuses.initSuccess ||
+ (this.status.type === databaseStatuses.initSuccess && !clearDatabase) ||
this.status.type === databaseStatuses.initError
) {
return;
}
- this.worker = new SharedWorker(DATABASE_WORKER_PATH);
- this.worker.onerror = console.error;
- this.workerProxy = new WorkerConnectionProxy(
- this.worker.port,
- console.error,
- );
+ const initPromise = (async () => {
+ if (clearDatabase && this.status.type === databaseStatuses.initSuccess) {
+ console.info('Clearing sensitive data');
+ invariant(this.workerProxy, 'Worker proxy should exist');
+ await this.workerProxy.scheduleOnWorker({
+ type: workerRequestMessageTypes.CLEAR_SENSITIVE_DATA,
+ });
+ }
- const origin = window.location.origin;
+ this.worker = new SharedWorker(DATABASE_WORKER_PATH);
+ this.worker.onerror = console.error;
+ this.workerProxy = new WorkerConnectionProxy(
+ this.worker.port,
+ console.error,
+ );
+
+ const origin = window.location.origin;
- const initPromise = (async () => {
try {
let encryptionKey = null;
if (isDesktopSafari) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 27, 1:42 PM (21 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2590574
Default Alt Text
D10306.id35119.diff (1 KB)
Attached To
Mode
D10306: [web] avoid race condition while deleting database
Attached
Detach File
Event Timeline
Log In to Comment