Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3180277
D9695.id33552.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
21 KB
Referenced Files
None
Subscribers
None
D9695.id33552.diff
View Options
diff --git a/lib/components/thread-draft-updater.react.js b/lib/components/thread-draft-updater.react.js
--- a/lib/components/thread-draft-updater.react.js
+++ b/lib/components/thread-draft-updater.react.js
@@ -18,7 +18,7 @@
const cachedThreadIDsRef = React.useRef<?Set<string>>();
if (!cachedThreadIDsRef.current) {
- const newCachedThreadIDs = new Set();
+ const newCachedThreadIDs = new Set<string>();
for (const realizedThreadID of pendingToRealizedThreadIDs.values()) {
newCachedThreadIDs.add(realizedThreadID);
}
diff --git a/lib/hooks/child-threads.js b/lib/hooks/child-threads.js
--- a/lib/hooks/child-threads.js
+++ b/lib/hooks/child-threads.js
@@ -33,9 +33,9 @@
const childThreads = useSelector(state => childThreadInfos(state)[threadID]);
const subchannelIDs = React.useMemo(() => {
if (!childThreads) {
- return new Set();
+ return new Set<string>();
}
- return new Set(
+ return new Set<string>(
childThreads.filter(predicate).map(threadInfo => threadInfo.id),
);
}, [childThreads, predicate]);
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
@@ -1528,13 +1528,13 @@
// Store message IDs already contained within threads so that we
// do not insert duplicates
- const existingMessageIDs = new Set();
+ const existingMessageIDs = new Set<string>();
for (const threadID in threads) {
threads[threadID].messageIDs.forEach(msgID => {
existingMessageIDs.add(msgID);
});
}
- const threadsNeedMsgIDsResorting = new Set();
+ const threadsNeedMsgIDsResorting = new Set<string>();
const actionPayloadMessages =
messageStoreOpsHandlers.translateClientDBData(payloadMessages);
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
@@ -195,7 +195,7 @@
threadStoreOperations,
};
} else if (action.type === saveMessagesActionType) {
- const threadIDToMostRecentTime = new Map();
+ const threadIDToMostRecentTime = new Map<string, number>();
for (const messageInfo of action.payload.rawMessageInfos) {
const current = threadIDToMostRecentTime.get(messageInfo.threadID);
if (!current || current < messageInfo.time) {
diff --git a/lib/selectors/nav-selectors.js b/lib/selectors/nav-selectors.js
--- a/lib/selectors/nav-selectors.js
+++ b/lib/selectors/nav-selectors.js
@@ -19,6 +19,7 @@
import type { BaseNavInfo } from '../types/nav-types.js';
import type { BaseAppState } from '../types/redux-types.js';
import type { RawThreadInfo, ThreadInfo } from '../types/thread-types.js';
+import type { UserInfo } from '../types/user-types.js';
import { getConfig } from '../utils/config.js';
import { values } from '../utils/objects.js';
import { useSelector } from '../utils/redux-utils.js';
@@ -94,7 +95,7 @@
state => state.currentUserInfo && state.currentUserInfo.id,
);
const nonViewerMembers = React.useMemo(() => {
- const allMembersOfAllThreads = new Map();
+ const allMembersOfAllThreads = new Map<string, UserInfo>();
for (const threadInfo of threadInfos) {
for (const member of threadInfo.members) {
const isParentAdmin = memberHasAdminPowers(member);
@@ -121,7 +122,7 @@
);
const memberMap = React.useMemo(() => {
- const result = new Map();
+ const result = new Map<string, UserInfo>();
for (const userInfo of nonViewerMembersWithENSNames) {
result.set(userInfo.id, userInfo);
}
diff --git a/lib/selectors/thread-selectors.js b/lib/selectors/thread-selectors.js
--- a/lib/selectors/thread-selectors.js
+++ b/lib/selectors/thread-selectors.js
@@ -420,7 +420,7 @@
) => $ReadOnlyMap<string, string> = createSelector(
(rawThreadInfos: RawThreadInfos) => rawThreadInfos,
(rawThreadInfos: RawThreadInfos) => {
- const result = new Map();
+ const result = new Map<string, string>();
for (const threadID in rawThreadInfos) {
const rawThreadInfo = rawThreadInfos[threadID];
if (
diff --git a/lib/selectors/user-selectors.js b/lib/selectors/user-selectors.js
--- a/lib/selectors/user-selectors.js
+++ b/lib/selectors/user-selectors.js
@@ -209,7 +209,7 @@
state => state.currentUserInfo && state.currentUserInfo.id,
state => state.threadStore.threadInfos,
(viewerID, threadInfos) => {
- const personalThreadMembers = new Set();
+ const personalThreadMembers = new Set<string>();
for (const threadID in threadInfos) {
const thread = threadInfos[threadID];
diff --git a/lib/shared/message-utils.js b/lib/shared/message-utils.js
--- a/lib/shared/message-utils.js
+++ b/lib/shared/message-utils.js
@@ -201,7 +201,7 @@
function usersInMessageInfos(
messageInfos: $ReadOnlyArray<MessageInfo | RawMessageInfo>,
): string[] {
- const userIDs = new Set();
+ const userIDs = new Set<string>();
for (const messageInfo of messageInfos) {
if (messageInfo.creatorID) {
userIDs.add(messageInfo.creatorID);
diff --git a/lib/shared/radix-tree.js b/lib/shared/radix-tree.js
--- a/lib/shared/radix-tree.js
+++ b/lib/shared/radix-tree.js
@@ -91,7 +91,7 @@
}
getAllMatchingPrefix(prefix: string): V[] {
- const result = new Set();
+ const result = new Set<V>();
const stack = [{ node: this.root, partLeft: prefix }];
while (stack.length > 0) {
const { node, partLeft: prevPartLeft } = stack.pop();
diff --git a/lib/shared/search-utils.js b/lib/shared/search-utils.js
--- a/lib/shared/search-utils.js
+++ b/lib/shared/search-utils.js
@@ -20,8 +20,9 @@
import type {
ChatMessageInfoItem,
MessageListData,
-} from '../selectors/chat-selectors';
-import type { MessageInfo, RawMessageInfo } from '../types/message-types';
+ ChatMessageItem,
+} from '../selectors/chat-selectors.js';
+import type { MessageInfo, RawMessageInfo } from '../types/message-types.js';
import { isComposableMessageType } from '../types/message-types.js';
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import { userRelationshipStatus } from '../types/relationship-types.js';
@@ -320,7 +321,7 @@
isComposableMessageType(item.messageInfo.type),
);
- const uniqueChatMessageInfoItemsMap = new Map();
+ const uniqueChatMessageInfoItemsMap = new Map<string, ChatMessageItem>();
chatMessageInfoItems.forEach(
item =>
item.messageInfo &&
diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js
--- a/lib/shared/thread-utils.js
+++ b/lib/shared/thread-utils.js
@@ -541,7 +541,7 @@
RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
>,
): Map<string, AccountUserInfo> {
- const memberMap = new Map();
+ const memberMap = new Map<string, AccountUserInfo>();
for (const member of members) {
const { id, role, username } = member;
if (!role || !username) {
@@ -560,7 +560,7 @@
const memberMap = memberLowercaseUsernameMap(threadInfo.members);
const mentions = extractUserMentionsFromText(text);
- const mentionedMembers = new Map();
+ const mentionedMembers = new Map<string, AccountUserInfo>();
for (const mention of mentions) {
const userInfo = memberMap.get(mention.toLowerCase());
if (userInfo) {
@@ -611,7 +611,7 @@
const { color, type: parentThreadType } = parentThreadInfo;
const threadName = trimText(messageTitle, 30);
- const initialMembers = new Map();
+ const initialMembers = new Map<string, UserIDAndUsername>();
const { id: viewerID, username: viewerUsername } = loggedInUserInfo;
initialMembers.set(viewerID, { id: viewerID, username: viewerUsername });
@@ -1208,7 +1208,7 @@
function identifyInvalidatedThreads(
updateInfos: $ReadOnlyArray<ClientUpdateInfo>,
): Set<string> {
- const invalidated = new Set();
+ const invalidated = new Set<string>();
for (const updateInfo of updateInfos) {
if (updateInfo.type === updateTypes.DELETE_THREAD) {
invalidated.add(updateInfo.threadID);
@@ -1640,7 +1640,7 @@
);
const [threadSearchResults, setThreadSearchResults] = React.useState(
- new Set(),
+ new Set<string>(),
);
const [usersSearchResults, setUsersSearchResults] = React.useState<
$ReadOnlyArray<GlobalAccountUserInfo>,
@@ -1649,7 +1649,7 @@
React.useEffect(() => {
(async () => {
const results = threadSearchIndex.getSearchResults(searchText);
- setThreadSearchResults(new Set(results));
+ setThreadSearchResults(new Set<string>(results));
const usersResults = await searchUsers(searchText);
setUsersSearchResults(usersResults);
})();
@@ -1836,7 +1836,7 @@
Object.keys(threadInfo.roles).forEach(roleID => {
const roleName = threadInfo.roles[roleID].name;
const rolePermissions = Object.keys(threadInfo.roles[roleID].permissions);
- const setOfUserSurfacedPermissions = new Set();
+ const setOfUserSurfacedPermissions = new Set<UserSurfacedPermission>();
rolePermissions.forEach(rolePermission => {
const userSurfacedPermission = Object.keys(
diff --git a/lib/socket/api-request-handler.react.js b/lib/socket/api-request-handler.react.js
--- a/lib/socket/api-request-handler.react.js
+++ b/lib/socket/api-request-handler.react.js
@@ -11,6 +11,7 @@
serverSocketMessageTypes,
type ClientSocketMessageWithoutID,
type ConnectionInfo,
+ type APIResponseServerSocketMessage,
} from '../types/socket-types.js';
import { registerActiveSocket } from '../utils/action-utils.js';
import { SocketOffline } from '../utils/errors.js';
@@ -84,10 +85,11 @@
type: clientSocketMessageTypes.API_REQUEST,
payload: request,
});
- const response = await inflightRequests.fetchResponse(
- messageID,
- serverSocketMessageTypes.API_RESPONSE,
- );
+ const response =
+ await inflightRequests.fetchResponse<APIResponseServerSocketMessage>(
+ messageID,
+ serverSocketMessageTypes.API_RESPONSE,
+ );
return response.payload;
};
}
diff --git a/lib/socket/socket.react.js b/lib/socket/socket.react.js
--- a/lib/socket/socket.react.js
+++ b/lib/socket/socket.react.js
@@ -62,6 +62,9 @@
type ConnectionStatus,
setLateResponseActionType,
type CommTransportLayer,
+ type ActivityUpdateResponseServerSocketMessage,
+ type ClientStateSyncServerSocketMessage,
+ type PongServerSocketMessage,
} from '../types/socket-types.js';
import { actionLogger } from '../utils/action-logger.js';
import type { DispatchActionPromise } from '../utils/action-utils.js';
@@ -572,10 +575,11 @@
type: serverRequestTypes.INITIAL_ACTIVITY_UPDATES,
activityUpdates: queuedActivityUpdates,
});
- activityUpdatePromise = inflightRequests.fetchResponse(
- messageID,
- serverSocketMessageTypes.ACTIVITY_UPDATE_RESPONSE,
- );
+ activityUpdatePromise =
+ inflightRequests.fetchResponse<ActivityUpdateResponseServerSocketMessage>(
+ messageID,
+ serverSocketMessageTypes.ACTIVITY_UPDATE_RESPONSE,
+ );
}
const sessionState = this.props.sessionStateFunc();
@@ -592,10 +596,11 @@
this.initializedWithUserState = this.props.preRequestUserState;
this.sendMessage(initialMessage);
- const stateSyncPromise = inflightRequests.fetchResponse(
- messageID,
- serverSocketMessageTypes.STATE_SYNC,
- );
+ const stateSyncPromise =
+ inflightRequests.fetchResponse<ClientStateSyncServerSocketMessage>(
+ messageID,
+ serverSocketMessageTypes.STATE_SYNC,
+ );
// https://flow.org/try/#1N4Igxg9gdgZglgcxALlAJwKYEMwBcD6aArlLnALYYrgA2WAzvXGCADQgYAeOBARgJ74AJhhhYiNXClzEM7DFCLl602QF92kEdQb8oYAAQwSeONAMAHNBHJx6GAII0aAHgAqyA8AMBqANoA1hj8nvQycFAIALqetpwYQgZqAHwAFAA6UAYGERZEuJ4AJABK2EIA8lA0-O7JrJkAlJ4ACta29i6F5bwAVgCyWBburAa4-BYYEDAGhVgA7lhwuMnJXpnZkFBhlm12GPQGALwGflEA3OsGm9tB-AfH3T0YeAB0t-SpufkNF1lGEGgDKkaBhcDkjgYAAxncEuAzvF4gyK4AAWMLgPh8DTWfw20BuwQh7z8cHOlzxWzBVhsewhX1wgWCZNxOxp9noLzy9BRqWp7QwP0uaku1zBmHoElw9wM80WYNabIwLywzl5u3Zgr+ooMAgAclhKJ5gH4wmgItFYnB4kI1BDgGpftkYACgSCwXAIdDYfDghykQhUejMdjgOSrviwbcib6Sczstk9QaMIz+FEIeLJfRY46kpdMLgiGgsonKL9hVBMrp9EYTGRzPYoEIAJJQJZwFV9fb0LAIDCpEOXN2jfa4BX8nNwaYZEAojDOCDpEAvMJYNBSgDqSx5i4Ci4aA5ZuBHY9pxxP9he4ogNAAbn2ZEQBTny5dZUtWfynDRUt4j2FzxgSSamobAgHeaBMNA1A3pCLwAEwAIwACwvJCIBqEAA
// $FlowFixMe fixed in Flow 0.214
@@ -761,7 +766,7 @@
this.state.inflightRequests,
'inflightRequests falsey inside sendPing',
);
- await this.state.inflightRequests.fetchResponse(
+ await this.state.inflightRequests.fetchResponse<PongServerSocketMessage>(
messageID,
serverSocketMessageTypes.PONG,
);
diff --git a/lib/types/filter-types.js b/lib/types/filter-types.js
--- a/lib/types/filter-types.js
+++ b/lib/types/filter-types.js
@@ -18,14 +18,15 @@
+type: 'threads',
+threadIDs: $ReadOnlyArray<string>,
};
-export type CalendarFilter = { +type: 'not_deleted' } | CalendarThreadFilter;
+type NotDeletedFilter = { +type: 'not_deleted' };
+export type CalendarFilter = NotDeletedFilter | CalendarThreadFilter;
export const calendarFilterValidator: TUnion<CalendarFilter> = t.union([
tShape<CalendarThreadFilter>({
type: tString('threads'),
threadIDs: t.list(tID),
}),
- tShape({ type: tString('not_deleted') }),
+ tShape<NotDeletedFilter>({ type: tString('not_deleted') }),
]);
export const defaultCalendarFilters: $ReadOnlyArray<CalendarFilter> = [
diff --git a/lib/types/request-types.js b/lib/types/request-types.js
--- a/lib/types/request-types.js
+++ b/lib/types/request-types.js
@@ -96,37 +96,41 @@
...EntryInconsistencyReportShape,
};
+type FailUnmentioned = Shape<{
+ +threadInfos: boolean,
+ +entryInfos: boolean,
+ +userInfos: boolean,
+}>;
+
+type StateChanges = Shape<{
+ +rawThreadInfos: RawThreadInfo[],
+ +rawEntryInfos: RawEntryInfo[],
+ +currentUserInfo: CurrentUserInfo,
+ +userInfos: AccountUserInfo[],
+ +deleteThreadIDs: string[],
+ +deleteEntryIDs: string[],
+ +deleteUserInfoIDs: string[],
+}>;
+
export type ServerCheckStateServerRequest = {
+type: 6,
+hashesToCheck: { +[key: string]: number },
- +failUnmentioned?: Shape<{
- +threadInfos: boolean,
- +entryInfos: boolean,
- +userInfos: boolean,
- }>,
- +stateChanges?: Shape<{
- +rawThreadInfos: RawThreadInfo[],
- +rawEntryInfos: RawEntryInfo[],
- +currentUserInfo: CurrentUserInfo,
- +userInfos: AccountUserInfo[],
- +deleteThreadIDs: string[],
- +deleteEntryIDs: string[],
- +deleteUserInfoIDs: string[],
- }>,
+ +failUnmentioned?: FailUnmentioned,
+ +stateChanges?: StateChanges,
};
const serverCheckStateServerRequestValidator =
tShape<ServerCheckStateServerRequest>({
type: tNumber(serverRequestTypes.CHECK_STATE),
hashesToCheck: t.dict(t.String, t.Number),
failUnmentioned: t.maybe(
- tShape({
+ tShape<FailUnmentioned>({
threadInfos: t.maybe(t.Boolean),
entryInfos: t.maybe(t.Boolean),
userInfos: t.maybe(t.Boolean),
}),
),
stateChanges: t.maybe(
- tShape({
+ tShape<StateChanges>({
rawThreadInfos: t.maybe(t.list(rawThreadInfoValidator)),
rawEntryInfos: t.maybe(t.list(rawEntryInfoValidator)),
currentUserInfo: t.maybe(currentUserInfoValidator),
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
@@ -304,18 +304,19 @@
payload: serverStateSyncSocketPayloadValidator,
});
+type ServerRequestsServerSocketMessagePayload = {
+ +serverRequests: $ReadOnlyArray<ServerServerRequest>,
+};
export type ServerRequestsServerSocketMessage = {
+type: 1,
+responseTo?: number,
- +payload: {
- +serverRequests: $ReadOnlyArray<ServerServerRequest>,
- },
+ +payload: ServerRequestsServerSocketMessagePayload,
};
export const serverRequestsServerSocketMessageValidator: TInterface<ServerRequestsServerSocketMessage> =
tShape<ServerRequestsServerSocketMessage>({
type: tNumber(serverSocketMessageTypes.REQUESTS),
responseTo: t.maybe(t.Number),
- payload: tShape({
+ payload: tShape<ServerRequestsServerSocketMessagePayload>({
serverRequests: t.list(serverServerRequestValidator),
}),
});
@@ -334,16 +335,18 @@
payload: t.maybe(t.Object),
});
+type SessionChange = {
+ +cookie: string,
+ +currentUserInfo: LoggedOutUserInfo,
+};
+
export type AuthErrorServerSocketMessage = {
- type: 3,
- responseTo: number,
- message: string,
+ +type: 3,
+ +responseTo: number,
+ +message: string,
// If unspecified, it is because the client is using cookieSources.HEADER,
// which means the server can't update the cookie from a socket message.
- sessionChange?: {
- cookie: string,
- currentUserInfo: LoggedOutUserInfo,
- },
+ +sessionChange?: SessionChange,
};
export const authErrorServerSocketMessageValidator: TInterface<AuthErrorServerSocketMessage> =
tShape<AuthErrorServerSocketMessage>({
@@ -351,7 +354,10 @@
responseTo: t.Number,
message: t.String,
sessionChange: t.maybe(
- tShape({ cookie: t.String, currentUserInfo: loggedOutUserInfoValidator }),
+ tShape<SessionChange>({
+ cookie: t.String,
+ currentUserInfo: loggedOutUserInfoValidator,
+ }),
),
});
diff --git a/lib/utils/comm-config.js b/lib/utils/comm-config.js
--- a/lib/utils/comm-config.js
+++ b/lib/utils/comm-config.js
@@ -19,7 +19,7 @@
return `${configName.folder}/${configName.name}.json`;
}
-const cachedJSON = new Map();
+const cachedJSON = new Map<string, mixed>();
// This function checks for an env var named COMM_JSONCONFIG_{folder}_{name}
// If it doesn't find one, it then looks for keyserver/{folder}/{name}.json
@@ -28,13 +28,13 @@
const key = getKeyForConfigName(configName);
const cached = cachedJSON.get(key);
if (cached !== undefined) {
- return cached;
+ return (cached: any);
}
- const json = await getJSON(configName);
+ const json = await getJSON<T>(configName);
if (!cachedJSON.has(key)) {
cachedJSON.set(key, json);
}
- return cachedJSON.get(key);
+ return (cachedJSON.get(key): any);
}
async function getJSON<T>(configName: ConfigName): Promise<?T> {
diff --git a/lib/utils/conversion-utils.test.js b/lib/utils/conversion-utils.test.js
--- a/lib/utils/conversion-utils.test.js
+++ b/lib/utils/conversion-utils.test.js
@@ -9,9 +9,11 @@
} from './conversion-utils.js';
import { tShape, tID, idSchemaRegex } from './validation-utils.js';
+type ComplexType = { +ids: { +[string]: $ReadOnlyArray<string> } };
+
describe('id conversion', () => {
it('should convert string id', () => {
- const validator = tShape({ id: tID });
+ const validator = tShape<{ +id: string }>({ id: tID });
const serverData = { id: '1' };
const clientData = { id: '0|1' };
@@ -24,7 +26,7 @@
});
it('should convert a complex type', () => {
- const validator = tShape({ ids: t.dict(tID, t.list(tID)) });
+ const validator = tShape<ComplexType>({ ids: t.dict(tID, t.list(tID)) });
const serverData = { ids: { '1': ['11', '12'], '2': [], '3': ['13'] } };
const clientData = {
ids: { '0|1': ['0|11', '0|12'], '0|2': [], '0|3': ['0|13'] },
diff --git a/lib/utils/ens-cache.js b/lib/utils/ens-cache.js
--- a/lib/utils/ens-cache.js
+++ b/lib/utils/ens-cache.js
@@ -200,10 +200,10 @@
ensNames = raceResult;
} catch (e) {
console.log(e);
- ensNames = new Array(needFetch.length).fill(null);
+ ensNames = new Array<?string>(needFetch.length).fill(null);
}
- const resultMap = new Map();
+ const resultMap = new Map<string, ?string>();
for (let i = 0; i < needFetch.length; i++) {
const ethAddress = needFetch[i];
let ensName = ensNames[i];
diff --git a/lib/utils/ens-helpers.js b/lib/utils/ens-helpers.js
--- a/lib/utils/ens-helpers.js
+++ b/lib/utils/ens-helpers.js
@@ -40,7 +40,7 @@
})
.filter(Boolean);
- const ensNames = new Map();
+ const ensNames = new Map<string, string>();
if (needFetch.length > 0) {
const results = await ensCache.getNamesForAddresses(needFetch);
for (let i = 0; i < needFetch.length; i++) {
diff --git a/lib/utils/pkcs7-padding.test.js b/lib/utils/pkcs7-padding.test.js
--- a/lib/utils/pkcs7-padding.test.js
+++ b/lib/utils/pkcs7-padding.test.js
@@ -114,7 +114,7 @@
// 2 blocks of data + 2 blocks of padding = 4 blocks total (1 superblock)
const padded = new Uint8Array([
...generateRandomArray(2 * 16),
- ...new Array(2 * 16).fill(2),
+ ...new Array<number>(2 * 16).fill(2),
]);
const unpadded = superblockUnpad(padded, blockSizeBytes);
@@ -127,7 +127,7 @@
const blockSizeBytes = 16;
const padded = new Uint8Array([
...generateRandomArray(2 * 16),
- ...new Array(2 * 16).fill(0),
+ ...new Array<number>(2 * 16).fill(0),
]);
expect(() => superblockUnpad(padded, blockSizeBytes)).toThrow();
});
@@ -137,7 +137,7 @@
// 4 blocks total, but filled with 5s
const padded = new Uint8Array([
...generateRandomArray(2 * 16),
- ...new Array(2 * 16).fill(5),
+ ...new Array<number>(2 * 16).fill(5),
]);
expect(() => superblockUnpad(padded, blockSizeBytes)).toThrow();
});
@@ -243,5 +243,5 @@
}
function generateRandomArray(length: number): Array<number> {
- return new Array(length).map(() => Math.floor(Math.random() * 256));
+ return new Array<void>(length).map(() => Math.floor(Math.random() * 256));
}
diff --git a/lib/utils/role-utils.js b/lib/utils/role-utils.js
--- a/lib/utils/role-utils.js
+++ b/lib/utils/role-utils.js
@@ -80,7 +80,7 @@
community ? threadInfoSelector(state)[community] : null,
);
const topMostThreadInfo = communityThreadInfo || threadInfo;
- const roleMap = new Map();
+ const roleMap = new Map<string, ?RoleInfo | ?MinimallyEncodedRoleInfo>();
if (topMostThreadInfo.type === threadTypes.GENESIS) {
memberInfos.forEach(memberInfo =>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 4:35 AM (21 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2448647
Default Alt Text
D9695.id33552.diff (21 KB)
Attached To
Mode
D9695: [Flow202][lib][skip-ci] [3/23] Fix Flow issues with types being underconstrained
Attached
Detach File
Event Timeline
Log In to Comment