Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32854942
D15022.1768111678.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
8 KB
Referenced Files
None
Subscribers
None
D15022.1768111678.diff
View Options
diff --git a/keyserver/src/creators/role-creator.js b/keyserver/src/creators/role-creator.js
--- a/keyserver/src/creators/role-creator.js
+++ b/keyserver/src/creators/role-creator.js
@@ -46,7 +46,7 @@
const time = Date.now();
const newRows = [];
const namesToIDs: { [string]: string } = {};
- for (const name in rolePermissions) {
+ for (const name of Object.keys(rolePermissions)) {
const id = ids.shift();
namesToIDs[name] = id;
const permissionsBlob = JSON.stringify(rolePermissions[name]);
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
@@ -224,7 +224,7 @@
const newNotifRows = [];
if (numRescinds > 0) {
invariant(dbIDs, 'dbIDs should be set');
- for (const rescindedID in deliveryResults) {
+ for (const rescindedID of Object.keys(deliveryResults)) {
const delivery: RescindDelivery = {
source: 'rescind',
rescindedID,
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
@@ -10,7 +10,7 @@
// functions.
function createBotViewer(userID: string): Viewer {
let userIDIsBot = false;
- for (const botName in bots) {
+ for (const botName of Object.keys(bots)) {
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
@@ -79,7 +79,7 @@
const directedDeleteIDs = [];
const messageDatas = [];
const now = Date.now();
- for (const userID in userRelationshipOperations) {
+ for (const userID of Object.keys(userRelationshipOperations)) {
const operations = userRelationshipOperations[userID];
const ids = sortUserIDs(viewer.userID, userID);
diff --git a/lib/permissions/prefixes.js b/lib/permissions/prefixes.js
--- a/lib/permissions/prefixes.js
+++ b/lib/permissions/prefixes.js
@@ -25,7 +25,7 @@
let remainingString = threadPermissionString;
let propagationPrefix;
- for (const key in threadPermissionPropagationPrefixes) {
+ for (const key of Object.keys(threadPermissionPropagationPrefixes)) {
const prefix = threadPermissionPropagationPrefixes[key];
if (!remainingString.startsWith(prefix)) {
continue;
@@ -36,7 +36,7 @@
}
let filterPrefix;
- for (const key in threadPermissionFilterPrefixes) {
+ for (const key of Object.keys(threadPermissionFilterPrefixes)) {
const prefix = threadPermissionFilterPrefixes[key];
if (!remainingString.startsWith(prefix)) {
continue;
@@ -47,7 +47,7 @@
}
let membershipPrefix;
- for (const key in threadPermissionMembershipPrefixes) {
+ for (const key of Object.keys(threadPermissionMembershipPrefixes)) {
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
@@ -45,7 +45,7 @@
threadID: string,
): ThreadPermissionsInfo {
const result: { [permission: ThreadPermission]: ThreadPermissionInfo } = {};
- for (const permissionName in threadPermissions) {
+ for (const permissionName of Object.keys(threadPermissions)) {
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
@@ -22,7 +22,7 @@
import { updateTypes } from '../../types/update-types-enum.js';
import type { ClientUpdateInfo } from '../../types/update-types.js';
import { blobHashFromBlobServiceURI } from '../../utils/blob-service.js';
-import { values } from '../../utils/objects.js';
+import { values, entries } from '../../utils/objects.js';
import { rawMessageInfoFromMessageData } from '../message-utils.js';
function getThreadIDFromChangeThreadSettingsDMOp(
@@ -87,8 +87,7 @@
normalizedThreadInfoUpdate = { ...rest };
}
- for (const fieldName in normalizedThreadInfoUpdate) {
- const value = normalizedThreadInfoUpdate[fieldName];
+ for (const [fieldName, value] of entries(normalizedThreadInfoUpdate)) {
const messageData: ChangeSettingsMessageData = {
type: messageTypes.CHANGE_SETTINGS,
threadID,
@@ -156,7 +155,7 @@
);
let threadInfoToUpdate: ThickRawThreadInfo = threadInfo;
- for (const fieldName in threadInfoUpdate) {
+ for (const fieldName of Object.keys(threadInfoUpdate)) {
const timestamp = threadInfoToUpdate.timestamps[fieldName];
if (timestamp < time) {
threadInfoToUpdate = {
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
@@ -12,7 +12,7 @@
if (staff.includes(userID)) {
return true;
}
- for (const key in bots) {
+ for (const key of Object.keys(bots)) {
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) {
+ for (const validatorMessageTypeName of Object.keys(messageTypes)) {
const validatorMessageType = messageTypes[validatorMessageTypeName];
const validator = messageSpecs[validatorMessageType].validator;
@@ -860,7 +860,7 @@
apiResponseServerSocketMessageValidator,
};
- for (const validatorMessageType in validatorByMessageType) {
+ for (const validatorMessageType of Object.keys(validatorByMessageType)) {
const validator = validatorByMessageType[validatorMessageType];
const validatorMessageTypeName = _findKey(
e => e === Number(validatorMessageType),
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
@@ -50,7 +50,7 @@
possiblyRunCommands() {
let openSlots: { [string]: number } = {};
- for (const type in this.currentCalls) {
+ for (const type of Object.keys(this.currentCalls)) {
const currentCalls = this.currentCalls[type];
const maxCalls = maxSimultaneousCalls[type];
const callsLeft = maxCalls - currentCalls;
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
@@ -94,7 +94,7 @@
rotated: updates.width > updates.height === defaultIsPortrait,
};
}
- for (const key in updates) {
+ for (const key of Object.keys(updates)) {
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
@@ -5,6 +5,7 @@
import { createSelector } from 'reselect';
import type { GlobalTheme } from 'lib/types/theme-types.js';
+import { entries } from 'lib/utils/objects.js';
import { selectBackgroundIsDark } from '../navigation/nav-selectors.js';
import { NavContext } from '../navigation/navigation-context.js';
@@ -389,7 +390,7 @@
);
const magicStrings = new Set<string>();
-for (const theme in colors) {
+for (const theme of Object.keys(colors)) {
for (const magicString in colors[theme]) {
magicStrings.add(magicString);
}
@@ -407,8 +408,7 @@
for (const key in obj) {
const style = obj[key];
const filledInStyle = { ...style };
- for (const styleKey in style) {
- const styleValue = style[styleKey];
+ for (const [styleKey, styleValue] of entries(style)) {
if (typeof styleValue !== 'string') {
continue;
}
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) {
+ for (const messageName of Object.keys(messageTypes)) {
const messageType = messageTypes[messageName];
if (
messageSpecs[messageType]?.getMessageNotifyType &&
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 11, 6:07 AM (3 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5918166
Default Alt Text
D15022.1768111678.diff (8 KB)
Attached To
Mode
D15022: [Flow262][skip-ci] Silence for..in errors
Attached
Detach File
Event Timeline
Log In to Comment