Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32213002
D11097.1765145483.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D11097.1765145483.diff
View Options
diff --git a/native/redux/client-db-utils.js b/native/redux/client-db-utils.js
--- a/native/redux/client-db-utils.js
+++ b/native/redux/client-db-utils.js
@@ -26,6 +26,32 @@
convertRawThreadInfoToClientDBThreadInfo,
} from 'lib/utils/thread-ops-utils.js';
+import type { AppState } from './state-types.js';
+import { commCoreModule } from '../native-modules.js';
+
+function updateClientDBThreadStoreThreadInfos(
+ state: AppState,
+ migrationFunc: RawThreadInfos => RawThreadInfos,
+ handleMigrationFailure?: AppState => AppState,
+): AppState {
+ const clientDBThreadInfos = commCoreModule.getAllThreadsSync();
+ const operations = createUpdateDBOpsForThreadStoreThreadInfos(
+ clientDBThreadInfos,
+ migrationFunc,
+ );
+
+ try {
+ commCoreModule.processThreadStoreOperationsSync(operations);
+ } catch (exception) {
+ console.log(exception);
+ if (handleMigrationFailure) {
+ return handleMigrationFailure(state);
+ }
+ return ({ ...state, cookie: null }: any);
+ }
+ return state;
+}
+
function createUpdateDBOpsForThreadStoreThreadInfos(
clientDBThreadInfos: $ReadOnlyArray<ClientDBThreadInfo>,
migrationFunc: RawThreadInfos => RawThreadInfos,
@@ -113,6 +139,7 @@
}
export {
+ updateClientDBThreadStoreThreadInfos,
createUpdateDBOpsForThreadStoreThreadInfos,
createUpdateDBOpsForMessageStoreMessages,
createUpdateDBOpsForMessageStoreThreads,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 7, 10:11 PM (12 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5846178
Default Alt Text
D11097.1765145483.diff (1 KB)
Attached To
Mode
D11097: [native] Reintroduce `updateClientDBThreadStoreThreadInfos`
Attached
Detach File
Event Timeline
Log In to Comment