diff --git a/ts/RemoteConfig.ts b/ts/RemoteConfig.ts index e2f0dc272a2d..640be65bf971 100644 --- a/ts/RemoteConfig.ts +++ b/ts/RemoteConfig.ts @@ -18,7 +18,6 @@ export type ConfigKeyType = | 'desktop.retryReceiptLifespan' | 'desktop.retryRespondMaxAge' | 'desktop.screensharing2' - | 'desktop.sendSenderKey2' | 'desktop.storage' | 'desktop.storageWrite3' | 'desktop.worksAtSignal' diff --git a/ts/background.ts b/ts/background.ts index 127277e4066b..d2e79166d0ab 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -2312,9 +2312,7 @@ export async function startApp(): Promise { announcementGroup: true, 'gv2-3': true, 'gv1-migration': true, - senderKey: window.Signal.RemoteConfig.isEnabled( - 'desktop.sendSenderKey2' - ), + senderKey: true, }); } catch (error) { window.log.error( diff --git a/ts/textsecure/WebAPI.ts b/ts/textsecure/WebAPI.ts index 2a93aef2c134..7d1c395b86a9 100644 --- a/ts/textsecure/WebAPI.ts +++ b/ts/textsecure/WebAPI.ts @@ -748,10 +748,10 @@ export type CapabilitiesType = { senderKey: boolean; }; export type CapabilitiesUploadType = { - announcementGroup: boolean; - 'gv2-3': boolean; - 'gv1-migration': boolean; - senderKey: boolean; + announcementGroup: true; + 'gv2-3': true; + 'gv1-migration': true; + senderKey: true; }; type StickerPackManifestType = any; @@ -1478,7 +1478,7 @@ export function initialize({ announcementGroup: true, 'gv2-3': true, 'gv1-migration': true, - senderKey: false, + senderKey: true, }; const { accessKey } = options; diff --git a/ts/util/handleRetry.ts b/ts/util/handleRetry.ts index 86862e6403d6..67e9733d5867 100644 --- a/ts/util/handleRetry.ts +++ b/ts/util/handleRetry.ts @@ -7,7 +7,8 @@ import { } from '@signalapp/signal-client'; import { isNumber } from 'lodash'; -import { assert } from './assert'; +import { isBeta } from './version'; +import { strictAssert } from './assert'; import { getSendOptions } from './getSendOptions'; import { handleMessageSend } from './handleMessageSend'; import { isGroupV2 } from './whatTypeOfConversation'; @@ -116,13 +117,11 @@ export async function onRetryRequest(event: RetryRequestEvent): Promise { } function maybeShowDecryptionToast(logId: string) { - if (!RemoteConfig.isEnabled('desktop.internalUser')) { + if (!isBeta(window.getVersion())) { return; } - window.log.info( - `onDecryptionError/${logId}: Showing toast for internal user` - ); + window.log.info(`onDecryptionError/${logId}: Showing decryption error toast`); window.Whisper.ToastView.show( window.Whisper.DecryptionErrorToast, document.getElementsByClassName('conversation-stack')[0] @@ -434,7 +433,7 @@ async function requestResend(decryptionError: DecryptionErrorEventData) { // We believe that it could be successfully re-sent, so we'll add a placeholder. if (contentHint === ContentHint.RESENDABLE) { const { retryPlaceholders } = window.Signal.Services; - assert(retryPlaceholders, 'requestResend: adding placeholder'); + strictAssert(retryPlaceholders, 'requestResend: adding placeholder'); window.log.info(`requestResend/${logId}: Adding placeholder`); diff --git a/ts/util/sendToGroup.ts b/ts/util/sendToGroup.ts index c161ca5c0a70..7097deb2b7be 100644 --- a/ts/util/sendToGroup.ts +++ b/ts/util/sendToGroup.ts @@ -18,7 +18,6 @@ import { SenderCertificateMode, SendLogCallbackType, } from '../textsecure/OutgoingMessage'; -import { isEnabled } from '../RemoteConfig'; import { isOlderThan } from './timestamp'; import { @@ -142,7 +141,6 @@ export async function sendContentMessageToGroup({ const ourConversation = window.ConversationController.get(ourConversationId); if ( - isEnabled('desktop.sendSenderKey2') && ourConversation?.get('capabilities')?.senderKey && isGroupV2(conversation.attributes) ) { diff --git a/ts/views/conversation_view.ts b/ts/views/conversation_view.ts index 984636f075c4..6df463850206 100644 --- a/ts/views/conversation_view.ts +++ b/ts/views/conversation_view.ts @@ -206,9 +206,10 @@ Whisper.TapToViewExpiredOutgoingToast = Whisper.ToastView.extend({ }); Whisper.DecryptionErrorToast = Whisper.ToastView.extend({ - className: 'toast toast-clickable', + className: 'toast toast-clickable decryption-error', events: { click: 'onClick', + keydown: 'onKeyDown', }, render_attributes() { return { @@ -218,6 +219,15 @@ Whisper.DecryptionErrorToast = Whisper.ToastView.extend({ // Note: this is the same thing as ToastView, except it's missing the setTimeout, so it // will stick around until the user interacts with it. render() { + const toasts = document.getElementsByClassName('decryption-error'); + if (toasts.length > 1) { + window.log.info( + 'DecryptionErrorToast: We are second decryption error toast. Closing.' + ); + this.close(); + return; + } + this.$el.html( window.Mustache.render( window._.result(this, 'template', ''), @@ -226,11 +236,23 @@ Whisper.DecryptionErrorToast = Whisper.ToastView.extend({ ); this.$el.attr('tabIndex', 0); this.$el.show(); + if (window.getInteractionMode() === 'keyboard') { + setTimeout(() => { + this.$el.focus(); + }, 1); + } }, onClick() { this.close(); window.showDebugLog(); }, + onKeyDown(event: KeyboardEvent) { + if (event.key !== 'Enter' && event.key !== ' ') { + return; + } + + this.onClick(); + }, }); Whisper.FileSavedToast = Whisper.ToastView.extend({