Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3382497
D13239.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13239.diff
View Options
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
@@ -71,6 +71,7 @@
localIDPrefix,
} from '../shared/message-utils.js';
import {
+ parsePendingThreadID,
threadHasPermission,
threadInChatList,
threadIsPending,
@@ -103,6 +104,7 @@
stateSyncPayloadTypes,
} from '../types/socket-types.js';
import { threadPermissions } from '../types/thread-permission-types.js';
+import { threadTypeIsThick } from '../types/thread-types-enum.js';
import type {
LegacyRawThreadInfo,
RawThreadInfos,
@@ -618,16 +620,27 @@
type: 'replace_threads',
payload: {
threads: Object.fromEntries(
- Object.entries(updatedThreads).map(([threadID, thread]) => [
- threadID,
- threadInfos[threadID].thick
- ? {
- ...thread,
- startReached:
- thread.messageIDs.length < defaultNumberPerThread,
- }
- : thread,
- ]),
+ Object.entries(updatedThreads).map(([threadID, thread]) => {
+ let isThreadThick;
+ if (threadInfos[threadID]) {
+ isThreadThick = threadInfos[threadID].thick;
+ } else {
+ const threadIDParseResult = parsePendingThreadID(threadID);
+ isThreadThick = threadIDParseResult
+ ? threadTypeIsThick(threadIDParseResult.threadType)
+ : false;
+ }
+ return [
+ threadID,
+ isThreadThick
+ ? {
+ ...thread,
+ startReached:
+ thread.messageIDs.length < defaultNumberPerThread,
+ }
+ : thread,
+ ];
+ }),
),
},
},
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 11:08 AM (19 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2596755
Default Alt Text
D13239.diff (1 KB)
Attached To
Mode
D13239: [lib] Don't assume that threads exist in thread store when merging new messages
Attached
Detach File
Event Timeline
Log In to Comment