Page MenuHomePhabricator

D10271.id34603.diff
No OneTemporary

D10271.id34603.diff

diff --git a/lib/shared/updates/update-thread-read-status-spec.js b/lib/shared/updates/update-thread-read-status-spec.js
--- a/lib/shared/updates/update-thread-read-status-spec.js
+++ b/lib/shared/updates/update-thread-read-status-spec.js
@@ -3,10 +3,7 @@
import t from 'tcomb';
import type { UpdateSpec } from './update-spec.js';
-import type {
- LegacyRawThreadInfo,
- LegacyRawThreadInfos,
-} from '../../types/thread-types.js';
+import type { RawThreadInfos } from '../../types/thread-types.js';
import { updateTypes } from '../../types/update-types-enum.js';
import type {
ThreadReadStatusUpdateInfo,
@@ -21,24 +18,35 @@
ThreadReadStatusUpdateData,
> = Object.freeze({
generateOpsForThreadUpdates(
- storeThreadInfos: LegacyRawThreadInfos,
+ storeThreadInfos: RawThreadInfos,
update: ThreadReadStatusUpdateInfo,
) {
- const storeThreadInfo: ?LegacyRawThreadInfo =
- storeThreadInfos[update.threadID];
if (
- !storeThreadInfo ||
- storeThreadInfo.currentUser.unread === update.unread
+ !storeThreadInfos[update.threadID] ||
+ storeThreadInfos[update.threadID].currentUser.unread === update.unread
) {
return null;
}
- const updatedThread = {
- ...storeThreadInfo,
- currentUser: {
- ...storeThreadInfo.currentUser,
- unread: update.unread,
- },
- };
+ const storeThreadInfo = storeThreadInfos[update.threadID];
+
+ let updatedThread;
+ if (storeThreadInfo.minimallyEncoded) {
+ updatedThread = {
+ ...storeThreadInfo,
+ currentUser: {
+ ...storeThreadInfo.currentUser,
+ unread: update.unread,
+ },
+ };
+ } else {
+ updatedThread = {
+ ...storeThreadInfo,
+ currentUser: {
+ ...storeThreadInfo.currentUser,
+ unread: update.unread,
+ },
+ };
+ }
return [
{
type: 'replace',

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 6, 10:37 PM (20 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2433425
Default Alt Text
D10271.id34603.diff (1 KB)

Event Timeline