Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3513051
D11931.id39920.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11931.id39920.diff
View Options
diff --git a/lib/types/sqlite-types.js b/lib/types/sqlite-types.js
--- a/lib/types/sqlite-types.js
+++ b/lib/types/sqlite-types.js
@@ -1,5 +1,7 @@
// @flow
+import type { StoreOperations } from './store-ops-types.js';
+
export type ReceivedMessageToDevice = {
+messageID: string,
+senderDeviceID: string,
@@ -15,4 +17,9 @@
+removeReceivedMessagesToDevice: (
ids: $ReadOnlyArray<string>,
) => Promise<void>,
+
+ +processDBStoreOperations: (
+ operations: StoreOperations,
+ userID?: ?string,
+ ) => Promise<void>,
};
diff --git a/lib/utils/__mocks__/config.js b/lib/utils/__mocks__/config.js
--- a/lib/utils/__mocks__/config.js
+++ b/lib/utils/__mocks__/config.js
@@ -28,6 +28,7 @@
sqliteAPI: {
getAllReceivedMessageToDevice: jest.fn(),
removeReceivedMessagesToDevice: jest.fn(),
+ processDBStoreOperations: jest.fn(),
},
});
diff --git a/native/database/sqlite-api.js b/native/database/sqlite-api.js
--- a/native/database/sqlite-api.js
+++ b/native/database/sqlite-api.js
@@ -3,6 +3,7 @@
import type { SQLiteAPI } from 'lib/types/sqlite-types.js';
import { commCoreModule } from '../native-modules.js';
+import { processDBStoreOperations } from '../redux/redux-utils.js';
const sqliteAPI: SQLiteAPI = {
// read operations
@@ -10,6 +11,8 @@
// write operations
removeReceivedMessagesToDevice: commCoreModule.removeReceivedMessagesToDevice,
+
+ processDBStoreOperations,
};
export { sqliteAPI };
diff --git a/web/database/sqlite-api.js b/web/database/sqlite-api.js
--- a/web/database/sqlite-api.js
+++ b/web/database/sqlite-api.js
@@ -6,6 +6,7 @@
} from 'lib/types/sqlite-types.js';
import { getCommSharedWorker } from '../shared-worker/shared-worker-provider.js';
+import { processDBStoreOperations } from '../shared-worker/utils/store.js';
import { workerRequestMessageTypes } from '../types/worker-types.js';
const sqliteAPI: SQLiteAPI = {
@@ -31,6 +32,8 @@
ids,
});
},
+
+ processDBStoreOperations,
};
export { sqliteAPI };
diff --git a/web/shared-worker/utils/store.js b/web/shared-worker/utils/store.js
--- a/web/shared-worker/utils/store.js
+++ b/web/shared-worker/utils/store.js
@@ -140,7 +140,7 @@
async function processDBStoreOperations(
storeOperations: StoreOperations,
- userID: null | string,
+ userID?: ?string,
): Promise<void> {
const {
draftStoreOperations,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 10:01 PM (15 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2692734
Default Alt Text
D11931.id39920.diff (2 KB)
Attached To
Mode
D11931: [lib] Expose function that processes operations as a part of SQLite API
Attached
Detach File
Event Timeline
Log In to Comment