Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3517597
D5982.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
D5982.diff
View Options
diff --git a/keyserver/src/responders/website-responders.js b/keyserver/src/responders/website-responders.js
--- a/keyserver/src/responders/website-responders.js
+++ b/keyserver/src/responders/website-responders.js
@@ -24,7 +24,6 @@
import { defaultEnabledReports } from 'lib/types/report-types';
import { defaultConnectionInfo } from 'lib/types/socket-types';
import { threadPermissions, threadTypes } from 'lib/types/thread-types';
-import type { CurrentUserInfo } from 'lib/types/user-types';
import { currentDateInTimeZone } from 'lib/utils/date-utils';
import { ServerError } from 'lib/utils/errors';
import { promiseAll } from 'lib/utils/promises';
@@ -309,10 +308,10 @@
var preloadedState =
`);
- const initialReduxState: any = await promiseAll({
+ const initialReduxState = await promiseAll({
navInfo: navInfoPromise,
deviceID: null,
- currentUserInfo: ((currentUserInfoPromise: any): Promise<CurrentUserInfo>),
+ currentUserInfo: currentUserInfoPromise,
draftStore: { drafts: {} },
sessionID: sessionIDPromise,
entryStore: entryStorePromise,
diff --git a/keyserver/src/utils/json-stream.js b/keyserver/src/utils/json-stream.js
--- a/keyserver/src/utils/json-stream.js
+++ b/keyserver/src/utils/json-stream.js
@@ -5,10 +5,9 @@
import replaceStream from 'replacestream';
import Combine from 'stream-combiner';
-type Promisable<T> = Promise<T> | T;
-function streamJSON<T: { [key: string]: Promisable<*> }>(
+function streamJSON(
res: $Response,
- input: T,
+ input: { +[key: string]: mixed },
): stream$Readable {
const jsonStream = Combine(
JSONStream.stringifyObject('{', ',', '}'),
@@ -19,9 +18,9 @@
return jsonStream;
}
-function resolvePromisesToStream<T: { [key: string]: Promisable<*> }>(
+function resolvePromisesToStream(
stream: { +write: ([string, mixed]) => mixed, +end: () => mixed, ... },
- input: T,
+ input: { +[key: string]: mixed },
) {
const blocking = [];
for (const key in input) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 5:50 PM (9 h, 20 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2695612
Default Alt Text
D5982.diff (1 KB)
Attached To
Mode
D5982: [keyserver] Fix JSONStream types
Attached
Detach File
Event Timeline
Log In to Comment