diff --git a/keyserver/src/push/rescind.js b/keyserver/src/push/rescind.js --- a/keyserver/src/push/rescind.js +++ b/keyserver/src/push/rescind.js @@ -234,6 +234,7 @@ delivery.errors = errors; } const dbID = dbIDs.shift(); + // $FlowFixMe const { userID, threadID, messageID } = notifInfo[rescindedID]; newNotifRows.push([ dbID, diff --git a/keyserver/src/session/bots.js b/keyserver/src/session/bots.js --- a/keyserver/src/session/bots.js +++ b/keyserver/src/session/bots.js @@ -11,6 +11,7 @@ function createBotViewer(userID: string): Viewer { let userIDIsBot = false; for (const botName in bots) { + // $FlowFixMe if (bots[botName].userID === userID) { userIDIsBot = true; break; diff --git a/keyserver/src/updaters/relationship-updaters.js b/keyserver/src/updaters/relationship-updaters.js --- a/keyserver/src/updaters/relationship-updaters.js +++ b/keyserver/src/updaters/relationship-updaters.js @@ -97,6 +97,7 @@ if (request.users[userID].createRobotextInThinThread) { messageDatas.push({ type: messageTypes.LEGACY_UPDATE_RELATIONSHIP, + // $FlowFixMe threadID: threadIDPerUser[userID], creatorID: viewer.userID, targetID: userID, @@ -110,6 +111,7 @@ if (request.users[userID].createRobotextInThinThread) { messageDatas.push({ type: messageTypes.LEGACY_UPDATE_RELATIONSHIP, + // $FlowFixMe threadID: threadIDPerUser[userID], creatorID: viewer.userID, targetID: userID, diff --git a/lib/permissions/prefixes.js b/lib/permissions/prefixes.js --- a/lib/permissions/prefixes.js +++ b/lib/permissions/prefixes.js @@ -26,6 +26,7 @@ let propagationPrefix; for (const key in threadPermissionPropagationPrefixes) { + // $FlowFixMe const prefix = threadPermissionPropagationPrefixes[key]; if (!remainingString.startsWith(prefix)) { continue; @@ -37,6 +38,7 @@ let filterPrefix; for (const key in threadPermissionFilterPrefixes) { + // $FlowFixMe const prefix = threadPermissionFilterPrefixes[key]; if (!remainingString.startsWith(prefix)) { continue; @@ -48,6 +50,7 @@ let membershipPrefix; for (const key in threadPermissionMembershipPrefixes) { + // $FlowFixMe const prefix = threadPermissionMembershipPrefixes[key]; if (!remainingString.startsWith(prefix)) { continue; diff --git a/lib/permissions/thread-permissions.js b/lib/permissions/thread-permissions.js --- a/lib/permissions/thread-permissions.js +++ b/lib/permissions/thread-permissions.js @@ -46,6 +46,7 @@ ): ThreadPermissionsInfo { const result: { [permission: ThreadPermission]: ThreadPermissionInfo } = {}; for (const permissionName in threadPermissions) { + // $FlowFixMe const permissionKey = threadPermissions[permissionName]; const permission = permissionLookup(permissions, permissionKey); let entry: ThreadPermissionInfo = { value: false, source: null }; diff --git a/lib/shared/dm-ops/change-thread-settings-spec.js b/lib/shared/dm-ops/change-thread-settings-spec.js --- a/lib/shared/dm-ops/change-thread-settings-spec.js +++ b/lib/shared/dm-ops/change-thread-settings-spec.js @@ -87,7 +87,7 @@ normalizedThreadInfoUpdate = { ...rest }; } - for (const fieldName in normalizedThreadInfoUpdate) { + Object.keys(normalizedThreadInfoUpdate).forEach(fieldName => { const value = normalizedThreadInfoUpdate[fieldName]; const messageData: ChangeSettingsMessageData = { type: messageTypes.CHANGE_SETTINGS, @@ -102,7 +102,7 @@ `${messageIDsPrefix}/${fieldName}`, ); fieldNameToMessageData[fieldName] = { messageData, rawMessageInfo }; - } + }); return { fieldNameToMessageData, threadInfoUpdate }; } @@ -156,7 +156,7 @@ ); let threadInfoToUpdate: ThickRawThreadInfo = threadInfo; - for (const fieldName in threadInfoUpdate) { + Object.keys(threadInfoUpdate).forEach(fieldName => { const timestamp = threadInfoToUpdate.timestamps[fieldName]; if (timestamp < time) { threadInfoToUpdate = { @@ -168,7 +168,7 @@ }, }; } - } + }); if (messageDataWithMessageInfoPairs.length > 0) { updateInfos.push({ diff --git a/lib/shared/staff-utils.js b/lib/shared/staff-utils.js --- a/lib/shared/staff-utils.js +++ b/lib/shared/staff-utils.js @@ -13,6 +13,7 @@ return true; } for (const key in bots) { + // $FlowFixMe const bot = bots[key]; if (userID === bot.userID) { return true; diff --git a/lib/types/validation.test.js b/lib/types/validation.test.js --- a/lib/types/validation.test.js +++ b/lib/types/validation.test.js @@ -318,7 +318,7 @@ ]; describe('message validation', () => { - for (const validatorMessageTypeName in messageTypes) { + Object.keys(messageTypes).forEach(validatorMessageTypeName => { const validatorMessageType = messageTypes[validatorMessageTypeName]; const validator = messageSpecs[validatorMessageType].validator; @@ -346,7 +346,7 @@ }); } } - } + }); }); const thread = { @@ -860,7 +860,7 @@ apiResponseServerSocketMessageValidator, }; - for (const validatorMessageType in validatorByMessageType) { + Object.keys(validatorByMessageType).forEach(validatorMessageType => { const validator = validatorByMessageType[validatorMessageType]; const validatorMessageTypeName = _findKey( e => e === Number(validatorMessageType), @@ -881,5 +881,5 @@ }); } } - } + }); }); diff --git a/native/media/media-processing-queue.js b/native/media/media-processing-queue.js --- a/native/media/media-processing-queue.js +++ b/native/media/media-processing-queue.js @@ -51,7 +51,9 @@ possiblyRunCommands() { let openSlots: { [string]: number } = {}; for (const type in this.currentCalls) { + // $FlowFixMe const currentCalls = this.currentCalls[type]; + // $FlowFixMe const maxCalls = maxSimultaneousCalls[type]; const callsLeft = maxCalls - currentCalls; if (!callsLeft) { diff --git a/native/redux/dimensions-updater.react.js b/native/redux/dimensions-updater.react.js --- a/native/redux/dimensions-updater.react.js +++ b/native/redux/dimensions-updater.react.js @@ -95,6 +95,7 @@ }; } for (const key in updates) { + // $FlowFixMe if (updates[key] === dimensions[key]) { continue; } diff --git a/native/themes/colors.js b/native/themes/colors.js --- a/native/themes/colors.js +++ b/native/themes/colors.js @@ -389,11 +389,11 @@ ); const magicStrings = new Set(); -for (const theme in colors) { +Object.keys(colors).forEach(theme => { for (const magicString in colors[theme]) { magicStrings.add(magicString); } -} +}); type Styles = { [name: string]: { +[field: string]: any } }; @@ -413,6 +413,7 @@ continue; } if (magicStrings.has(styleValue)) { + // $FlowFixMe const mapped = themeColors[styleValue]; if (mapped) { filledInStyle[styleKey] = mapped; diff --git a/native/types/message-types-validator.js b/native/types/message-types-validator.js --- a/native/types/message-types-validator.js +++ b/native/types/message-types-validator.js @@ -9,7 +9,7 @@ if (__DEV__) { const messageTypesCpp = new Set(commConstants.NATIVE_MESSAGE_TYPES); const missingMessageTypesCpp = []; - for (const messageName in messageTypes) { + Object.keys(messageTypes).forEach(messageName => { const messageType = messageTypes[messageName]; if ( messageSpecs[messageType]?.getMessageNotifyType && @@ -17,7 +17,7 @@ ) { missingMessageTypesCpp.push(messageName); } - } + }); if (missingMessageTypesCpp.length !== 0) { Alert.alert(