Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3332641
D12409.id43374.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D12409.id43374.diff
View Options
diff --git a/lib/reducers/master-reducer.js b/lib/reducers/master-reducer.js
--- a/lib/reducers/master-reducer.js
+++ b/lib/reducers/master-reducer.js
@@ -83,12 +83,7 @@
// Only allow checkpoints to increase if we are connected
// or if the action is a STATE_SYNC
const { messageStoreOperations, messageStore: reducedMessageStore } =
- reduceMessageStore(
- state.messageStore,
- action,
- threadInfos,
- onStateDifferenceForStaff,
- );
+ reduceMessageStore(state.messageStore, action, threadInfos);
let messageStore = reducedMessageStore;
let { keyserverStore, keyserverStoreOperations } = reduceKeyserverStore(
diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js
--- a/lib/reducers/message-reducer.js
+++ b/lib/reducers/message-reducer.js
@@ -111,9 +111,7 @@
type ClientUpdateInfo,
processUpdatesActionType,
} from '../types/update-types.js';
-import { getMessageForException } from '../utils/errors.js';
import { translateClientDBThreadMessageInfos } from '../utils/message-ops-utils.js';
-import { assertObjectsAreEqual } from '../utils/objects.js';
const _mapValuesWithKeys = _mapValues.convert({ cap: false });
@@ -146,31 +144,6 @@
);
}
-function assertMessageStoreLocalMessageInfosAreEqual(
- processedMessageStore: MessageStore,
- expectedMessageStore: MessageStore,
- location: string,
- onStateDifference?: (message: string) => mixed,
-) {
- try {
- assertObjectsAreEqual(
- processedMessageStore.local,
- expectedMessageStore.local,
- `MessageStore.local - ${location}`,
- );
- } catch (e) {
- console.log(
- 'Error processing MessageStore local ops',
- processedMessageStore.local,
- expectedMessageStore.local,
- );
- const message = `Error processing MessageStore local ops ${
- getMessageForException(e) ?? '{no exception message}'
- }`;
- onStateDifference?.(message);
- }
-}
-
const newThread = (): ThreadMessageInfo => ({
messageIDs: [],
startReached: false,
@@ -779,7 +752,6 @@
messageStore: MessageStore,
action: BaseAction,
newThreadInfos: RawThreadInfos,
- onStateDifference?: (message: string) => mixed,
): ReduceMessageStoreResult {
if (
action.type === legacyLogInActionTypes.success ||
@@ -1688,16 +1660,6 @@
const actionPayloadMessageStoreLocalMessageInfos =
action.payload.messageStoreLocalMessageInfos ?? {};
- assertMessageStoreLocalMessageInfosAreEqual(
- {
- ...messageStore,
- local: actionPayloadMessageStoreLocalMessageInfos,
- },
- messageStore,
- action.type,
- onStateDifference,
- );
-
const newThreads: {
[threadID: string]: ThreadMessageInfo,
} = { ...messageStore.threads };
@@ -1712,13 +1674,21 @@
if (!payloadMessages) {
return {
messageStoreOperations: [],
- messageStore: { ...messageStore, threads: newThreads },
+ messageStore: {
+ ...messageStore,
+ threads: newThreads,
+ local: actionPayloadMessageStoreLocalMessageInfos,
+ },
};
}
const { messageStoreOperations, messageStore: updatedMessageStore } =
updateMessageStoreWithLatestThreadInfos(
- { ...messageStore, threads: newThreads },
+ {
+ ...messageStore,
+ threads: newThreads,
+ local: actionPayloadMessageStoreLocalMessageInfos,
+ },
newThreadInfos,
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 12:39 AM (16 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2541868
Default Alt Text
D12409.id43374.diff (3 KB)
Attached To
Mode
D12409: [lib] Use sqlite for message store local instead of redux persist
Attached
Detach File
Event Timeline
Log In to Comment