Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32400345
D10609.1765340351.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D10609.1765340351.diff
View Options
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
@@ -94,16 +94,10 @@
{
type: 'remove_all',
},
- ...Object.keys(newThreadInfos).map((id: string) => {
- invariant(
- newThreadInfos[id].minimallyEncoded,
- 'newThreadInfos must be minimallyEncoded for current clients',
- );
- return {
- type: 'replace',
- payload: { id, threadInfo: newThreadInfos[id] },
- };
- }),
+ ...Object.keys(newThreadInfos).map((id: string) => ({
+ type: 'replace',
+ payload: { id, threadInfo: newThreadInfos[id] },
+ })),
];
const updatedThreadStore = processThreadStoreOperations(
state,
diff --git a/lib/types/socket-types.js b/lib/types/socket-types.js
--- a/lib/types/socket-types.js
+++ b/lib/types/socket-types.js
@@ -33,7 +33,10 @@
type ClientClientResponse,
} from './request-types.js';
import type { SessionState, SessionIdentification } from './session-types.js';
-import { type RawThreadInfos } from './thread-types.js';
+import type {
+ RawThreadInfos,
+ MinimallyEncodedRawThreadInfos,
+} from './thread-types.js';
import {
type ClientUpdatesResult,
type ClientUpdatesResultWithUserInfos,
@@ -184,41 +187,42 @@
export const fullStateSyncActionType = 'FULL_STATE_SYNC';
export type BaseFullStateSync = {
+messagesResult: MessagesResponse,
- +threadInfos: RawThreadInfos,
+rawEntryInfos: $ReadOnlyArray<RawEntryInfo>,
+userInfos: $ReadOnlyArray<UserInfo>,
+updatesCurrentAsOf: number,
};
const baseFullStateSyncValidator = tShape<BaseFullStateSync>({
messagesResult: messagesResponseValidator,
- threadInfos: t.dict(tID, rawThreadInfoValidator),
rawEntryInfos: t.list(rawEntryInfoValidator),
userInfos: t.list(userInfoValidator),
updatesCurrentAsOf: t.Number,
});
-export type ClientFullStateSync = {
+export type ClientFullStateSync = $ReadOnly<{
...BaseFullStateSync,
+ +threadInfos: MinimallyEncodedRawThreadInfos,
+currentUserInfo: CurrentUserInfo,
-};
-export type StateSyncFullActionPayload = {
+}>;
+export type StateSyncFullActionPayload = $ReadOnly<{
...ClientFullStateSync,
+calendarQuery: CalendarQuery,
+keyserverID: string,
-};
-export type ClientStateSyncFullSocketPayload = {
+}>;
+export type ClientStateSyncFullSocketPayload = $ReadOnly<{
...ClientFullStateSync,
+type: 0,
// Included iff client is using sessionIdentifierTypes.BODY_SESSION_ID
+sessionID?: string,
-};
+}>;
-export type ServerFullStateSync = {
+export type ServerFullStateSync = $ReadOnly<{
...BaseFullStateSync,
+ +threadInfos: RawThreadInfos,
+currentUserInfo: CurrentUserInfo,
-};
+}>;
const serverFullStateSyncValidator = tShape<ServerFullStateSync>({
...baseFullStateSyncValidator.meta.props,
+ threadInfos: t.dict(tID, rawThreadInfoValidator),
currentUserInfo: currentUserInfoValidator,
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 10, 4:19 AM (15 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5859231
Default Alt Text
D10609.1765340351.diff (2 KB)
Attached To
Mode
D10609: [lib] Narrow `ClientFullStateSync` to `MinimallyEncodedRawThreadInfos`
Attached
Detach File
Event Timeline
Log In to Comment