Page MenuHomePhabricator

D7664.diff
No OneTemporary

D7664.diff

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
@@ -1613,8 +1613,14 @@
},
};
} else if (action.type === setClientDBStoreActionType) {
+ const payloadMessages = action.payload.messages;
+ if (!payloadMessages) {
+ return { messageStoreOperations: [], messageStore };
+ }
const actionPayloadMessageStoreThreads =
- translateClientDBThreadMessageInfos(action.payload.messageStoreThreads);
+ translateClientDBThreadMessageInfos(
+ action.payload.messageStoreThreads ?? [],
+ );
const newThreads = {};
for (const threadID in actionPayloadMessageStoreThreads) {
@@ -1649,7 +1655,7 @@
}
const threadsNeedMsgIDsResorting = new Set();
const actionPayloadMessages =
- translateClientDBMessageInfosToRawMessageInfos(action.payload.messages);
+ translateClientDBMessageInfosToRawMessageInfos(payloadMessages);
// When starting the app on native, we filter out any local-only multimedia
// messages because the relevant context is no longer available
diff --git a/lib/reducers/thread-reducer.js b/lib/reducers/thread-reducer.js
--- a/lib/reducers/thread-reducer.js
+++ b/lib/reducers/thread-reducer.js
@@ -473,7 +473,7 @@
};
} else if (action.type === setClientDBStoreActionType) {
return {
- threadStore: action.payload.threadStore,
+ threadStore: action.payload.threadStore ?? state,
newThreadInconsistencies: [],
threadStoreOperations: [],
};
diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js
--- a/lib/types/redux-types.js
+++ b/lib/types/redux-types.js
@@ -599,9 +599,9 @@
+payload: {
+currentUserID: ?string,
+drafts: $ReadOnlyArray<ClientDBDraftInfo>,
- +messages: $ReadOnlyArray<ClientDBMessageInfo>,
- +threadStore: ThreadStore,
- +messageStoreThreads: $ReadOnlyArray<ClientDBThreadMessageInfo>,
+ +messages: ?$ReadOnlyArray<ClientDBMessageInfo>,
+ +threadStore: ?ThreadStore,
+ +messageStoreThreads: ?$ReadOnlyArray<ClientDBThreadMessageInfo>,
},
}
| {

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 5:58 AM (20 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574209
Default Alt Text
D7664.diff (2 KB)

Event Timeline