From aad55025ba14d11ab317c12ce48e382d5220ec8a Mon Sep 17 00:00:00 2001 From: William Grant Date: Fri, 13 Oct 2023 11:59:00 +1100 Subject: [PATCH] fix: more comment cleanup --- ts/components/conversation/SubtleNotification.tsx | 2 +- ts/node/migration/helpers/v34.ts | 1 - ts/node/sql.ts | 1 - ts/receiver/closedGroups.ts | 3 +-- ts/session/disappearing_messages/index.ts | 1 - ts/session/disappearing_messages/types.ts | 2 +- ts/session/utils/sync/syncUtils.ts | 1 - ts/types/attachments/migrations.ts | 7 +++---- ts/util/releaseFeature.ts | 5 ++--- ts/window.d.ts | 3 +-- 10 files changed, 9 insertions(+), 17 deletions(-) diff --git a/ts/components/conversation/SubtleNotification.tsx b/ts/components/conversation/SubtleNotification.tsx index adb5bd07a..1a1730b9d 100644 --- a/ts/components/conversation/SubtleNotification.tsx +++ b/ts/components/conversation/SubtleNotification.tsx @@ -63,7 +63,7 @@ export const NoMessageInConversation = () => { const isMe = useSelectedIsNoteToSelf(); const canWrite = useSelector(getSelectedCanWrite); const privateBlindedAndBlockingMsgReqs = useSelectedHasDisabledBlindedMsgRequests(); - // TODOLATER use this selector accross the whole application (left pane excluded) + // TODOLATER use this selector across the whole application (left pane excluded) const nameToRender = useSelectedNicknameOrProfileNameOrShortenedPubkey(); if (!selectedConversation || hasMessage) { diff --git a/ts/node/migration/helpers/v34.ts b/ts/node/migration/helpers/v34.ts index d4d5b527f..e8fc25141 100644 --- a/ts/node/migration/helpers/v34.ts +++ b/ts/node/migration/helpers/v34.ts @@ -154,7 +154,6 @@ function updateContactInContactWrapper( priority, dbCreatedAtSeconds: Math.floor((contact.active_at || Date.now()) / 1000), expirationMode: contact.expirationMode || 'off', - // TODO rename expireTimer to expirationTimer expireTimer: contact.expireTimer || 0, }); diff --git a/ts/node/sql.ts b/ts/node/sql.ts index 0f7f05c62..686fb3576 100644 --- a/ts/node/sql.ts +++ b/ts/node/sql.ts @@ -427,7 +427,6 @@ function saveConversation(data: ConversationAttributes): SaveConversationReturn zombies, left, expirationMode, - // TODO rename expireTimer to expirationTimer expireTimer, lastDisappearingMessageChangeTimestamp, hasOutdatedClient, diff --git a/ts/receiver/closedGroups.ts b/ts/receiver/closedGroups.ts index d2e6bd969..d034c547c 100644 --- a/ts/receiver/closedGroups.ts +++ b/ts/receiver/closedGroups.ts @@ -16,6 +16,7 @@ import { ConversationModel } from '../models/conversation'; import { ConversationTypeEnum } from '../models/conversationAttributes'; import { getSwarmPollingInstance } from '../session/apis/snode_api'; +import { GetNetworkTime } from '../session/apis/snode_api/getNetworkTime'; import { SnodeNamespaces } from '../session/apis/snode_api/namespaces'; import { ClosedGroupEncryptionPairReplyMessage } from '../session/messages/outgoing/controlMessage/group/ClosedGroupEncryptionPairReplyMessage'; import { UserUtils } from '../session/utils'; @@ -27,7 +28,6 @@ import { ConfigWrapperObjectTypes } from '../webworker/workers/browser/libsessio import { getSettingsKeyFromLibsessionWrapper } from './configMessage'; import { ECKeyPair, HexKeyPair } from './keypairs'; import { queueAllCachedFromSource } from './receiver'; -import { GetNetworkTime } from '../session/apis/snode_api/getNetworkTime'; export const distributingClosedGroupEncryptionKeyPairs = new Map(); @@ -301,7 +301,6 @@ export async function handleNewClosedGroup( return; } const groupConvo = getConversationController().get(groupId); - // TODO Rename to expirationTimer const expireTimer = groupUpdate.expirationTimer; if (groupConvo) { diff --git a/ts/session/disappearing_messages/index.ts b/ts/session/disappearing_messages/index.ts index 2dac2b10f..8c54de7ca 100644 --- a/ts/session/disappearing_messages/index.ts +++ b/ts/session/disappearing_messages/index.ts @@ -442,7 +442,6 @@ export function getMessageReadyToDisappear( const { expirationType, - // TODO renamed expireTimer to expirationTimer expirationTimer: expireTimer, lastDisappearingMessageChangeTimestamp, isLegacyConversationSettingMessage, diff --git a/ts/session/disappearing_messages/types.ts b/ts/session/disappearing_messages/types.ts index 10e842a5f..f9f705a15 100644 --- a/ts/session/disappearing_messages/types.ts +++ b/ts/session/disappearing_messages/types.ts @@ -11,7 +11,7 @@ export const DisappearingMessageConversationModes = [ // TODO legacy messages support will be removed in a future release 'legacy', ] as const; -export type DisappearingMessageConversationModeType = typeof DisappearingMessageConversationModes[number]; // TODO we should make this type a bit more hardcoded than being just resolved as a string +export type DisappearingMessageConversationModeType = typeof DisappearingMessageConversationModes[number]; // TODO legacy messages support will be removed in a future release // expirationType and lastDisappearingMessageChangeTimestamp will no longer have an undefined option diff --git a/ts/session/utils/sync/syncUtils.ts b/ts/session/utils/sync/syncUtils.ts index cb4d13b8a..9fdb3b265 100644 --- a/ts/session/utils/sync/syncUtils.ts +++ b/ts/session/utils/sync/syncUtils.ts @@ -342,7 +342,6 @@ const buildSyncExpireTimerMessage = ( ) => { const { expirationType, - // TODO rename expireTimer to expirationTimer expirationTimer: expireTimer, lastDisappearingMessageChangeTimestamp, } = expireUpdate; diff --git a/ts/types/attachments/migrations.ts b/ts/types/attachments/migrations.ts index 7a613fbac..74353e6e7 100644 --- a/ts/types/attachments/migrations.ts +++ b/ts/types/attachments/migrations.ts @@ -3,8 +3,8 @@ import { pathExists } from 'fs-extra'; import { isString } from 'lodash'; -import * as MIME from '../MIME'; import * as GoogleChrome from '../../util/GoogleChrome'; +import * as MIME from '../MIME'; import { toLogFormat } from './Errors'; import { @@ -14,13 +14,13 @@ import { writeNewAttachmentData, } from '../MessageAttachment'; import { + THUMBNAIL_CONTENT_TYPE, + THUMBNAIL_SIDE, getImageDimensions, makeImageThumbnailBuffer, makeObjectUrl, makeVideoScreenshot, revokeObjectUrl, - THUMBNAIL_CONTENT_TYPE, - THUMBNAIL_SIDE, } from './VisualAttachment'; // Returns true if `rawAttachment` is a valid attachment based on our current schema. @@ -177,7 +177,6 @@ export const deleteData = async (attachment: { throw new TypeError('deleteData: attachment is not valid'); } - // TODO verify this works correctly let { path, thumbnail, screenshot } = attachment; if (path && isString(path)) { diff --git a/ts/util/releaseFeature.ts b/ts/util/releaseFeature.ts index 882f7c610..058ce7853 100644 --- a/ts/util/releaseFeature.ts +++ b/ts/util/releaseFeature.ts @@ -1,8 +1,8 @@ import { GetNetworkTime } from '../session/apis/snode_api/getNetworkTime'; +import { FEATURE_RELEASE_TIMESTAMPS } from '../session/constants'; import { ConfigurationSync } from '../session/utils/job_runners/jobs/ConfigurationSyncJob'; import { assertUnreachable } from '../types/sqlSharedTypes'; import { Storage } from './storage'; -import { FEATURE_RELEASE_TIMESTAMPS } from '../session/constants'; let isDisappearingMessageFeatureReleased: boolean | undefined; let isUserConfigLibsessionFeatureReleased: boolean | undefined; @@ -118,8 +118,7 @@ export const ReleasedFeatures = { isDisappearMessageV2FeatureReleasedCached, }; -// DO NOT MERGE -// TODO Remove before PR +// TODO DO NOT MERGE Remove after QA async function setIsFeatureReleased(featureName: FeatureNameTracked, value: boolean) { await Storage.put(featureStorageItemId(featureName), value); setIsFeatureReleasedCached(featureName, value); diff --git a/ts/window.d.ts b/ts/window.d.ts index 1e04b6842..f42703884 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -105,8 +105,7 @@ declare global { setAutoUpdateEnabled: (enabled: boolean) => void; setZoomFactor: (newZoom: number) => void; updateZoomFactor: () => void; - // DO NOT MERGE - // TODO Remove before PR + // TODO DO NOT MERGE Remove after QA setIsFeatureReleased: (featureName: FeatureNameTracked, value: boolean) => Promise; Signal: any;