Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3492443
D12367.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12367.diff
View Options
diff --git a/keyserver/src/socket/fetch-data.js b/keyserver/src/socket/fetch-data.js
--- a/keyserver/src/socket/fetch-data.js
+++ b/keyserver/src/socket/fetch-data.js
@@ -82,7 +82,7 @@
+userInfos: Promise<$ReadOnlyArray<UserInfo>>,
} = (promises: any);
const results = await promiseAll(castPromises);
- const payload: ServerStateSyncFullSocketPayload = {
+ let payload: ServerStateSyncFullSocketPayload = {
type: stateSyncPayloadTypes.FULL,
messagesResult,
threadInfos: results.threadInfos,
@@ -97,7 +97,7 @@
// and specify viewer.sessionChanged
const { sessionID } = viewer;
invariant(sessionID !== null && sessionID !== undefined, 'should be set');
- payload.sessionID = sessionID;
+ payload = { ...payload, sessionID };
viewer.sessionChanged = false;
}
return payload;
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
@@ -228,12 +228,12 @@
currentUserInfo: currentUserInfoValidator,
});
-export type ServerStateSyncFullSocketPayload = {
+export type ServerStateSyncFullSocketPayload = $ReadOnly<{
...ServerFullStateSync,
+type: 0,
// Included iff client is using sessionIdentifierTypes.BODY_SESSION_ID
+sessionID?: string,
-};
+}>;
const serverStateSyncFullSocketPayloadValidator =
tShape<ServerStateSyncFullSocketPayload>({
...serverFullStateSyncValidator.meta.props,
@@ -255,33 +255,33 @@
userInfos: t.list(userInfoValidator),
});
-export type ClientIncrementalStateSync = {
+export type ClientIncrementalStateSync = $ReadOnly<{
...BaseIncrementalStateSync,
+updatesResult: ClientUpdatesResult,
-};
-export type StateSyncIncrementalActionPayload = {
+}>;
+export type StateSyncIncrementalActionPayload = $ReadOnly<{
...ClientIncrementalStateSync,
+calendarQuery: CalendarQuery,
+keyserverID: string,
-};
-type ClientStateSyncIncrementalSocketPayload = {
+}>;
+export type ClientStateSyncIncrementalSocketPayload = $ReadOnly<{
+type: 1,
...ClientIncrementalStateSync,
-};
+}>;
-export type ServerIncrementalStateSync = {
+export type ServerIncrementalStateSync = $ReadOnly<{
...BaseIncrementalStateSync,
+updatesResult: ServerUpdatesResult,
-};
+}>;
const serverIncrementalStateSyncValidator = tShape<ServerIncrementalStateSync>({
...baseIncrementalStateSyncValidator.meta.props,
updatesResult: serverUpdatesResultValidator,
});
-type ServerStateSyncIncrementalSocketPayload = {
+type ServerStateSyncIncrementalSocketPayload = $ReadOnly<{
+type: 1,
...ServerIncrementalStateSync,
-};
+}>;
const serverStateSyncIncrementalSocketPayloadValidator =
tShape<ServerStateSyncIncrementalSocketPayload>({
type: tNumber(stateSyncPayloadTypes.INCREMENTAL),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 11:58 PM (21 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2679228
Default Alt Text
D12367.diff (2 KB)
Attached To
Mode
D12367: [lib] Add $ReadOnly wrapper around type spreads in socket-types.js
Attached
Detach File
Event Timeline
Log In to Comment