Page MenuHomePhabricator

D13576.id44829.diff
No OneTemporary

D13576.id44829.diff

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
@@ -335,9 +335,31 @@
const changedThreadInfos: { [string]: RawThreadInfo } = {};
for (const [threadID, mostRecentTime] of threadIDToMostRecentTime) {
const threadInfo = state.threadInfos[threadID];
+ if (!threadInfo || threadInfo.currentUser.unread) {
+ continue;
+ }
+ // Not checking timestamp to do the same thing as we
+ // do in `getThreadUpdatesForNewMessages`.
+ if (threadInfo.thick) {
+ changedThreadInfos[threadID] = {
+ ...threadInfo,
+ currentUser: {
+ ...threadInfo.currentUser,
+ unread: true,
+ },
+ timestamps: {
+ ...threadInfo.timestamps,
+ currentUser: {
+ ...threadInfo.timestamps.currentUser,
+ unread: mostRecentTime,
+ },
+ },
+ };
+ continue;
+ }
+
if (
- !threadInfo ||
- threadInfo.currentUser.unread ||
+ !action.payload.updatesCurrentAsOf ||
action.payload.updatesCurrentAsOf > mostRecentTime
) {
continue;
diff --git a/lib/types/message-types.js b/lib/types/message-types.js
--- a/lib/types/message-types.js
+++ b/lib/types/message-types.js
@@ -669,7 +669,7 @@
export type SaveMessagesPayload = {
+rawMessageInfos: $ReadOnlyArray<RawMessageInfo>,
- +updatesCurrentAsOf: number,
+ +updatesCurrentAsOf: ?number,
};
export type NewMessagesPayload = {
diff --git a/native/push/push-handler.react.js b/native/push/push-handler.react.js
--- a/native/push/push-handler.react.js
+++ b/native/push/push-handler.react.js
@@ -668,9 +668,6 @@
for (const keyserverID in keyserverIDToMessageInfos) {
const updatesCurrentAsOf = this.props.allUpdatesCurrentAsOf[keyserverID];
const messageInfos = keyserverIDToMessageInfos[keyserverID];
- if (!updatesCurrentAsOf) {
- continue;
- }
this.props.dispatch({
type: saveMessagesActionType,

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 3, 11:35 AM (15 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2223204
Default Alt Text
D13576.id44829.diff (2 KB)

Event Timeline