Page MenuHomePhabricator

D12367.diff
No OneTemporary

D12367.diff

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

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)

Event Timeline