From ec25d2f97fc597f2716e9a96d4d547fbd94cce8d Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 22 Feb 2024 17:00:43 +1100 Subject: [PATCH 1/4] chore: bump Session to 1.12.0 --- package.json | 2 +- .../OverlayDisappearingMessages.tsx | 2 +- ts/session/constants.ts | 7 +------ ts/util/releaseFeature.ts | 17 ++++++++--------- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 12f70835a..6e22d0daf 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "session-desktop", "productName": "Session", "description": "Private messaging from your desktop", - "version": "1.11.8", + "version": "1.12.0", "license": "GPL-3.0", "author": { "name": "Oxen Labs", diff --git a/ts/components/conversation/right-panel/overlay/disappearing-messages/OverlayDisappearingMessages.tsx b/ts/components/conversation/right-panel/overlay/disappearing-messages/OverlayDisappearingMessages.tsx index b0e970bcf..a81aa6c4d 100644 --- a/ts/components/conversation/right-panel/overlay/disappearing-messages/OverlayDisappearingMessages.tsx +++ b/ts/components/conversation/right-panel/overlay/disappearing-messages/OverlayDisappearingMessages.tsx @@ -13,7 +13,7 @@ import { useSelectedConversationKey, useSelectedExpireTimer, useSelectedIsGroupOrCommunity, - useSelectedWeAreAdmin + useSelectedWeAreAdmin, } from '../../../../../state/selectors/selectedConversation'; import { ReleasedFeatures } from '../../../../../util/releaseFeature'; import { Flex } from '../../../../basic/Flex'; diff --git a/ts/session/constants.ts b/ts/session/constants.ts index 7a55b33f5..b93d9ee9e 100644 --- a/ts/session/constants.ts +++ b/ts/session/constants.ts @@ -71,11 +71,6 @@ export const REACT_LIMIT = 6; export const MAX_USERNAME_BYTES = 64; export const FEATURE_RELEASE_TIMESTAMPS = { - // TODO update to agreed value between platforms for `disappearing_messages` - DISAPPEARING_MESSAGES_V2: 1706778000000, // unix 01/02/2024 09:00 - // TODO DO NOT MERGE Remove after QA - // NOTE for testing purposes only - // DISAPPEARING_MESSAGES_V2: 1677488400000, // unix 27/02/2023 09:00 - + DISAPPEARING_MESSAGES_V2: 1710147600000, // unix 11/03/2024 09:00 USER_CONFIG: 1690761600000, // Monday July 31st at 10am Melbourne time }; diff --git a/ts/util/releaseFeature.ts b/ts/util/releaseFeature.ts index 7854e507c..17f573575 100644 --- a/ts/util/releaseFeature.ts +++ b/ts/util/releaseFeature.ts @@ -100,10 +100,10 @@ async function checkIsUserConfigFeatureReleased() { } async function checkIsDisappearMessageV2FeatureReleased() { - return true; - // ((await checkIsFeatureReleased('disappearing_messages')) || - // !!process.env.MULTI?.toLocaleLowerCase().includes('disappear_v2') // FIXME to remove after QA - // ); + return ( + (await checkIsFeatureReleased('disappearing_messages')) || + !!process.env.MULTI?.toLocaleLowerCase().includes('disappear_v2') + ); // FIXME to remove after QA } function isUserConfigFeatureReleasedCached(): boolean { @@ -112,11 +112,10 @@ function isUserConfigFeatureReleasedCached(): boolean { // NOTE Make sure to call checkIsDisappearMessageV2FeatureReleased at least once and then use this. It's mostly used in components that are rendered where we don't want to do async calls function isDisappearMessageV2FeatureReleasedCached(): boolean { - return true; - // return ( - // !!isDisappearingMessageFeatureReleased || - // !!process.env.MULTI?.toLocaleLowerCase().includes('disappear_v2') // FIXME to remove after QA - // ); + return ( + !!isDisappearingMessageFeatureReleased || + !!process.env.MULTI?.toLocaleLowerCase().includes('disappear_v2') // FIXME to remove after QA + ); } export const ReleasedFeatures = { From bc30064c57ed62a99391e555a0f4ca0f5ed5ddb2 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 22 Feb 2024 17:07:42 +1100 Subject: [PATCH 2/4] chore: fix timestamp of release of disappear v2 --- ts/session/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/session/constants.ts b/ts/session/constants.ts index b93d9ee9e..7b2535b7e 100644 --- a/ts/session/constants.ts +++ b/ts/session/constants.ts @@ -71,6 +71,6 @@ export const REACT_LIMIT = 6; export const MAX_USERNAME_BYTES = 64; export const FEATURE_RELEASE_TIMESTAMPS = { - DISAPPEARING_MESSAGES_V2: 1710147600000, // unix 11/03/2024 09:00 + DISAPPEARING_MESSAGES_V2: 1710198000000, // 12/03/2024 10:00 Melbourne time USER_CONFIG: 1690761600000, // Monday July 31st at 10am Melbourne time }; From 9d984355dcb7642730e7eb2d1800b0ec5ef639a2 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 27 Feb 2024 11:37:54 +1100 Subject: [PATCH 3/4] fix: do not force ttl for groupExpireTimerUpdate --- .../conversation/TimerNotification.tsx | 1 + ts/models/conversation.ts | 24 ++++++++++++------- .../ExpirationTimerUpdateMessage.ts | 8 +++++++ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/ts/components/conversation/TimerNotification.tsx b/ts/components/conversation/TimerNotification.tsx index 4ed9b45bf..2dd26fc7d 100644 --- a/ts/components/conversation/TimerNotification.tsx +++ b/ts/components/conversation/TimerNotification.tsx @@ -187,6 +187,7 @@ export const TimerNotification = (props: PropsForExpirationTimer) => { const textToRender = useTextToRender(props); const isGroupOrCommunity = useSelectedIsGroupOrCommunity(); const isGroupV2 = useSelectedIsGroupV2(); + // renderOff is true when the update is put to off, or when we have a legacy group control message (as they are not expiring at all) const renderOffIcon = props.disabled || (isGroupOrCommunity && !isGroupV2); if (!textToRender || textToRender.length === 0) { diff --git a/ts/models/conversation.ts b/ts/models/conversation.ts index 93b053402..4423c0ca6 100644 --- a/ts/models/conversation.ts +++ b/ts/models/conversation.ts @@ -882,15 +882,23 @@ export class ConversationModel extends Backbone.Model { expirationMode = 'off'; expireTimer = 0; } + const shouldAddExpireUpdateMsgPrivate = this.isPrivate() && !fromConfigMessage; + const isLegacyGroup = this.isClosedGroup() && !PubKey.isClosedGroupV3(this.id); + + /** + * it's ugly, but we want to add a message for legacy groups only when + * - not coming from a config message + * - effectively changes the setting + * - ignores a off setting for a legacy group (as we can get a setting from restored from configMessage, and a newgroup can still be in the swarm when linking a device + */ + const shouldAddExpireUpdateMsgGroup = + isLegacyGroup && + !fromConfigMessage && + (expirationMode !== this.get('expirationMode') || expireTimer !== this.get('expireTimer')) && + expirationMode !== 'off'; + const shouldAddExpireUpdateMessage = - (this.isPrivate() && !fromConfigMessage) || - (this.isClosedGroup() && - !PubKey.isClosedGroupV3(this.id) && - !fromConfigMessage && - expirationMode !== this.get('expirationMode') && - expireTimer !== this.get('expireTimer') && - expirationMode !== 'off' && - expireTimer !== 0); + shouldAddExpireUpdateMsgPrivate || shouldAddExpireUpdateMsgGroup; // When we add a disappearing messages notification to the conversation, we want it // to be above the message that initiated that change, hence the subtraction. diff --git a/ts/session/messages/outgoing/controlMessage/ExpirationTimerUpdateMessage.ts b/ts/session/messages/outgoing/controlMessage/ExpirationTimerUpdateMessage.ts index effb98a2d..c9bb43820 100644 --- a/ts/session/messages/outgoing/controlMessage/ExpirationTimerUpdateMessage.ts +++ b/ts/session/messages/outgoing/controlMessage/ExpirationTimerUpdateMessage.ts @@ -1,4 +1,5 @@ import { SignalService } from '../../../../protobuf'; +import { TTL_DEFAULT } from '../../../constants'; import { PubKey } from '../../../types'; import { StringUtils } from '../../../utils'; import { DataMessage } from '../DataMessage'; @@ -60,4 +61,11 @@ export class ExpirationTimerUpdateMessage extends DataMessage { return data; } + + public ttl(): number { + if (this.groupId) { + return TTL_DEFAULT.CONTENT_MESSAGE; + } + return super.ttl(); + } } From 72182d81576b08e5d33d19386a0fc016c4c09573 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 28 Feb 2024 13:56:45 +1100 Subject: [PATCH 4/4] chore: bump timed release of disappear v2 to 13/03/24 --- ts/session/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/session/constants.ts b/ts/session/constants.ts index 7b2535b7e..72602b720 100644 --- a/ts/session/constants.ts +++ b/ts/session/constants.ts @@ -71,6 +71,6 @@ export const REACT_LIMIT = 6; export const MAX_USERNAME_BYTES = 64; export const FEATURE_RELEASE_TIMESTAMPS = { - DISAPPEARING_MESSAGES_V2: 1710198000000, // 12/03/2024 10:00 Melbourne time + DISAPPEARING_MESSAGES_V2: 1710284400000, // 13/03/2024 10:00 Melbourne time USER_CONFIG: 1690761600000, // Monday July 31st at 10am Melbourne time };