From a459bff86cc1283979d4bbadd91ccfd0538b5b47 Mon Sep 17 00:00:00 2001 From: William Grant Date: Fri, 13 Oct 2023 11:46:56 +1100 Subject: [PATCH] fix: more comment cleanup --- ts/models/message.ts | 3 --- ts/models/messageFactory.ts | 2 +- ts/models/messageType.ts | 4 ++-- ts/node/migration/helpers/index.ts | 6 ++---- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ts/models/message.ts b/ts/models/message.ts index c1e27c8f0..d80d52f6a 100644 --- a/ts/models/message.ts +++ b/ts/models/message.ts @@ -1022,9 +1022,6 @@ export class MessageModel extends Backbone.Model { throw new Error('Cannot trigger syncMessage with unknown convo.'); } - // window.log.debug( - // `WIP: sendSyncMessage: running checkForExpireUpdateInContentMessage for ${this.id}` - // ); const expireUpdate = await checkForExpireUpdateInContentMessage(content, conversation, true); const syncMessage = buildSyncMessage( diff --git a/ts/models/messageFactory.ts b/ts/models/messageFactory.ts index 12ad0f2ca..28929f545 100644 --- a/ts/models/messageFactory.ts +++ b/ts/models/messageFactory.ts @@ -80,7 +80,7 @@ function getSharedAttributesForPublicMessage({ isPublic: true, conversationId, messageHash: '', // we do not care of a messageHash for an opengroup message. we have serverId for that - // Note Community messages do not have an expiration + // NOTE Community messages do support disappearing messages expirationStartTimestamp: undefined, }; } diff --git a/ts/models/messageType.ts b/ts/models/messageType.ts index 883196af8..22e674fb2 100644 --- a/ts/models/messageType.ts +++ b/ts/models/messageType.ts @@ -136,10 +136,10 @@ export enum MessageDirection { any = '%', } -export interface PropsForDataExtractionNotification extends DataExtractionNotificationMsg { +export type PropsForDataExtractionNotification = DataExtractionNotificationMsg & { name: string; messageId: string; -} +}; export type PropsForMessageRequestResponse = MessageRequestResponseMsg & { conversationId?: string; diff --git a/ts/node/migration/helpers/index.ts b/ts/node/migration/helpers/index.ts index 96799d90d..f10e8dfc2 100644 --- a/ts/node/migration/helpers/index.ts +++ b/ts/node/migration/helpers/index.ts @@ -1,14 +1,12 @@ /* eslint-disable max-len */ /* - -When doing migrations that related to libsession we cannot share useful functions between migrations because the typings for libsession can change between versions. +When doing migrations that relate to libsession we cannot share useful functions between migrations because the typings for libsession can change between versions. To fix this, we now put these "helper" functions in a migration number specific file that can be trusted to have the correct typings and values for that version of libsession. In order for this to work, any properties on an object type exported from libsession need to be optional. This is because we cannot guarantee that the value will exist on the object in the version of libsession that we are migrating from. -Any helper functions that are exported from a helper file must have run checkTargetMigration(version, targetVersion); on the first line to confirm that the helper function is being reference within the correct migration. It will throw an error otherwise. - +Any helper functions that are exported from a helper file must run checkTargetMigration(version, targetVersion); on the first line to confirm that the helper function is being referenced within the correct migration. It will throw an error otherwise. */ /* eslint-enable max-len */