Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3269640
D12409.id41254.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.id41254.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
@@ -86,12 +86,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
@@ -110,9 +110,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 });
@@ -145,31 +143,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,
@@ -778,7 +751,6 @@
messageStore: MessageStore,
action: BaseAction,
newThreadInfos: RawThreadInfos,
- onStateDifference?: (message: string) => mixed,
): ReduceMessageStoreResult {
if (
action.type === legacyLogInActionTypes.success ||
@@ -1687,16 +1659,6 @@
const actionPayloadMessageStoreLocalMessageInfos =
action.payload.messageStoreLocalMessageInfos ?? {};
- assertMessageStoreLocalMessageInfosAreEqual(
- {
- ...messageStore,
- local: actionPayloadMessageStoreLocalMessageInfos,
- },
- messageStore,
- action.type,
- onStateDifference,
- );
-
const newThreads: {
[threadID: string]: ThreadMessageInfo,
} = { ...messageStore.threads };
@@ -1711,7 +1673,11 @@
if (!payloadMessages) {
return {
messageStoreOperations: [],
- messageStore: { ...messageStore, threads: newThreads },
+ messageStore: {
+ ...messageStore,
+ threads: newThreads,
+ local: actionPayloadMessageStoreLocalMessageInfos,
+ },
};
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 4:07 AM (17 h, 47 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2512876
Default Alt Text
D12409.id41254.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