Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3348008
D8611.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
D8611.diff
View Options
diff --git a/web/database/types/sqlite-query-executor.js b/web/database/types/sqlite-query-executor.js
--- a/web/database/types/sqlite-query-executor.js
+++ b/web/database/types/sqlite-query-executor.js
@@ -23,6 +23,10 @@
setPersistStorageItem(key: string, item: string): void;
removePersistStorageItem(key: string): void;
getPersistStorageItem(key: string): string;
+
+ // method is provided to manually signal that a C++ object
+ // is no longer needed and can be deleted
+ delete(): void;
}
export type SQLiteQueryExecutorType = typeof SQLiteQueryExecutor;
diff --git a/web/database/utils/db-utils.js b/web/database/utils/db-utils.js
--- a/web/database/utils/db-utils.js
+++ b/web/database/utils/db-utils.js
@@ -7,9 +7,20 @@
import { isDev } from 'lib/utils/dev-utils.js';
import { DB_SUPPORTED_BROWSERS, DB_SUPPORTED_OS } from './constants.js';
+import { type EmscriptenModule } from '../types/module.js';
+import { type SQLiteQueryExecutor } from '../types/sqlite-query-executor.js';
const browser = detectBrowser();
+function clearSensitiveData(
+ dbModule: EmscriptenModule,
+ path: string,
+ sqliteQueryExecutor: SQLiteQueryExecutor,
+) {
+ sqliteQueryExecutor.delete();
+ dbModule.FS.unlink(path);
+}
+
function parseSQLiteQueryResult<T>(result: QueryExecResult): T[] {
const { columns, values } = result;
return values.map(rowResult => {
@@ -49,4 +60,9 @@
const isDesktopSafari: boolean =
browser && browser.name === 'safari' && browser.os === 'Mac OS';
-export { parseMultiStatementSQLiteResult, isSQLiteSupported, isDesktopSafari };
+export {
+ parseMultiStatementSQLiteResult,
+ isSQLiteSupported,
+ isDesktopSafari,
+ clearSensitiveData,
+};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 1:39 PM (19 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2570947
Default Alt Text
D8611.diff (1 KB)
Attached To
Mode
D8611: [web] implement function to clear database content
Attached
Detach File
Event Timeline
Log In to Comment