From e216d9ed65c7c80966ab73c89f7077e7566d86ee Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Wed, 25 Nov 2026 12:35:00 +0100 Subject: [PATCH 1/3] fix: keep the returned-payment toast until it is closed Later toasts wait behind it instead of replacing it while it shows, and a second identical one from another restored swap is not queued again. Verified: just compile, just test, just lint --- .../bitkit/ui/shared/toast/ToastEventBus.kt | 12 +++++- .../ui/shared/toast/ToastQueueManager.kt | 4 +- .../to/bitkit/viewmodels/WalletViewModel.kt | 6 ++- .../java/to/bitkit/ui/WalletViewModelTest.kt | 11 ++++-- .../ui/shared/toast/ToastQueueManagerTest.kt | 39 +++++++++++++++++++ changelog.d/next/2030.fixed.md | 1 + 6 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 changelog.d/next/2030.fixed.md diff --git a/app/src/main/java/to/bitkit/ui/shared/toast/ToastEventBus.kt b/app/src/main/java/to/bitkit/ui/shared/toast/ToastEventBus.kt index fce89497c8..22fc69a08d 100644 --- a/app/src/main/java/to/bitkit/ui/shared/toast/ToastEventBus.kt +++ b/app/src/main/java/to/bitkit/ui/shared/toast/ToastEventBus.kt @@ -16,9 +16,19 @@ object ToastEventBus { visibilityTime: Long = Toast.VISIBILITY_TIME_DEFAULT, testTag: String? = null, replacedByNext: Boolean = false, + interruptible: Boolean = true, ) { _events.emit( - Toast(type, title, description, autoHide, visibilityTime, testTag, replacedByNext = replacedByNext) + Toast( + type = type, + title = title, + description = description, + autoHide = autoHide, + visibilityTime = visibilityTime, + testTag = testTag, + interruptible = interruptible, + replacedByNext = replacedByNext, + ) ) } diff --git a/app/src/main/java/to/bitkit/ui/shared/toast/ToastQueueManager.kt b/app/src/main/java/to/bitkit/ui/shared/toast/ToastQueueManager.kt index 337b07507d..5c1401d64f 100644 --- a/app/src/main/java/to/bitkit/ui/shared/toast/ToastQueueManager.kt +++ b/app/src/main/java/to/bitkit/ui/shared/toast/ToastQueueManager.kt @@ -39,9 +39,11 @@ class ToastQueueManager(private val scope: CoroutineScope) { /** * Add toast to queue. If queue is full, drops oldest. A shown or queued loading toast returns after the new one, * and a shown toast that is not interruptible stays until it hides. A queued progress toast is replaced by the new - * one, as it would have been on screen. + * one, as it would have been on screen. A toast that is not interruptible and already shown or queued is not added + * again. */ fun enqueue(toast: Toast) { + if (!toast.interruptible && (toast == _currentToast.value || toast in _queue.value)) return val isCurrentInterruptible = _currentToast.value?.interruptible != false val interruptedLoading = _currentToast.value?.takeIf { it.isLoading && isCurrentInterruptible } _queue.update { current -> diff --git a/app/src/main/java/to/bitkit/viewmodels/WalletViewModel.kt b/app/src/main/java/to/bitkit/viewmodels/WalletViewModel.kt index 0b6c46ff54..c9a6d8bd97 100644 --- a/app/src/main/java/to/bitkit/viewmodels/WalletViewModel.kt +++ b/app/src/main/java/to/bitkit/viewmodels/WalletViewModel.kt @@ -598,13 +598,15 @@ class WalletViewModel @Inject constructor( swaps.restored.forEach { swapId -> launch { pubkySwapsRouteRepo.awaitClaim(swapId).onSuccess { - // The claim also opens the received sheet above the toasts: stay until dismissed so the - // user still sees why the money came back once that sheet closes. + // The claim also opens the received sheet above the toasts: stay until dismissed, with + // later toasts waiting behind, so the user still sees why the money came back once that + // sheet closes. ToastEventBus.send( type = Toast.ToastType.INFO, title = context.getString(R.string.wallet__swap_route_restored_title), description = context.getString(R.string.wallet__swap_route_restored_text), autoHide = false, + interruptible = false, ) } } diff --git a/app/src/test/java/to/bitkit/ui/WalletViewModelTest.kt b/app/src/test/java/to/bitkit/ui/WalletViewModelTest.kt index d858b4459b..54dcb1c5e1 100644 --- a/app/src/test/java/to/bitkit/ui/WalletViewModelTest.kt +++ b/app/src/test/java/to/bitkit/ui/WalletViewModelTest.kt @@ -373,10 +373,15 @@ class WalletViewModelTest : BaseUnitTest() { ) lightningState.value = lightningState.value.copy(nodeLifecycleState = NodeLifecycleState.Running) - sut.restoreWallet("mnemonic", "passphrase") - walletState.value = walletState.value.copy(walletExists = true) - advanceUntilIdle() + ToastEventBus.events.test { + sut.restoreWallet("mnemonic", "passphrase") + walletState.value = walletState.value.copy(walletExists = true) + advanceUntilIdle() + val toast = awaitItem() + assertFalse(toast.autoHide) + assertFalse(toast.interruptible) + } assertEquals(RestoreState.Completed(emptySet()), sut.restoreState.value) verify(pubkySwapsRouteRepo).restoredSwaps() verify(pubkySwapsRouteRepo).awaitClaim(eq("swap"), any(), anyOrNull()) diff --git a/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt b/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt index d0946eb8ca..4fdbb48ea1 100644 --- a/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt +++ b/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt @@ -116,6 +116,45 @@ class ToastQueueManagerTest : BaseUnitTest() { assertEquals(onlineToast, sut.currentToast.value) } + @Test + fun `later toasts wait until a shown toast that is not interruptible is dismissed`() = test { + val sut = ToastQueueManager(backgroundScope) + val returnedToast = Toast( + type = Toast.ToastType.INFO, + title = "Payment returned", + autoHide = false, + interruptible = false, + ) + val offlineToast = Toast(type = Toast.ToastType.WARNING, title = "Offline", autoHide = true) + val onlineToast = Toast(type = Toast.ToastType.SUCCESS, title = "Back online", autoHide = true) + sut.enqueue(returnedToast) + + sut.enqueue(offlineToast) + sut.enqueue(onlineToast) + advanceTimeBy(Toast.VISIBILITY_TIME_DEFAULT * 2) + + assertEquals(returnedToast, sut.currentToast.value) + sut.dismissCurrentToast() + assertEquals(offlineToast, sut.currentToast.value) + } + + @Test + fun `a toast that is not interruptible is shown once when sent twice`() = test { + val sut = ToastQueueManager(backgroundScope) + val returnedToast = Toast( + type = Toast.ToastType.INFO, + title = "Payment returned", + autoHide = false, + interruptible = false, + ) + sut.enqueue(returnedToast) + + sut.enqueue(returnedToast.copy()) + sut.dismissCurrentToast() + + assertNull(sut.currentToast.value) + } + @Test fun `loading toast returns after a toast that interrupts it`() = test { val sut = ToastQueueManager(backgroundScope) diff --git a/changelog.d/next/2030.fixed.md b/changelog.d/next/2030.fixed.md new file mode 100644 index 0000000000..3446d0fa3c --- /dev/null +++ b/changelog.d/next/2030.fixed.md @@ -0,0 +1 @@ +The "Payment returned to Savings" notice now stays on screen until you close it. From 93a062a82cef8927c8a7dc3241da94724c2c0269 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Wed, 25 Nov 2026 13:36:19 +0100 Subject: [PATCH 2/3] fix: drop a waiting offline warning once a newer toast arrives Verified: just compile, just test, just lint --- .../main/java/to/bitkit/ui/components/IsOnlineTracker.kt | 2 ++ app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt | 2 ++ .../to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt | 9 +++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/to/bitkit/ui/components/IsOnlineTracker.kt b/app/src/main/java/to/bitkit/ui/components/IsOnlineTracker.kt index b11474e625..fa70c67b10 100644 --- a/app/src/main/java/to/bitkit/ui/components/IsOnlineTracker.kt +++ b/app/src/main/java/to/bitkit/ui/components/IsOnlineTracker.kt @@ -42,6 +42,8 @@ fun IsOnlineTracker( type = Toast.ToastType.WARNING, title = resources.getString(R.string.other__connection_issue), description = resources.getString(R.string.other__connection_issue_explain), + // A warning still waiting behind another toast is out of date once the connection is back. + replacedByNext = true, ) } diff --git a/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt b/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt index 7d4832b714..37c119b471 100644 --- a/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt +++ b/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt @@ -9355,6 +9355,7 @@ class AppViewModel @Inject constructor( autoHide: Boolean = true, visibilityTime: Long = Toast.VISIBILITY_TIME_DEFAULT, testTag: String? = null, + replacedByNext: Boolean = false, ) { toastManager.enqueue( Toast( @@ -9364,6 +9365,7 @@ class AppViewModel @Inject constructor( autoHide = autoHide, visibilityTime = visibilityTime, testTag = testTag, + replacedByNext = replacedByNext, ) ) } diff --git a/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt b/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt index 4fdbb48ea1..07079d3347 100644 --- a/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt +++ b/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt @@ -125,7 +125,12 @@ class ToastQueueManagerTest : BaseUnitTest() { autoHide = false, interruptible = false, ) - val offlineToast = Toast(type = Toast.ToastType.WARNING, title = "Offline", autoHide = true) + val offlineToast = Toast( + type = Toast.ToastType.WARNING, + title = "Offline", + autoHide = true, + replacedByNext = true, + ) val onlineToast = Toast(type = Toast.ToastType.SUCCESS, title = "Back online", autoHide = true) sut.enqueue(returnedToast) @@ -135,7 +140,7 @@ class ToastQueueManagerTest : BaseUnitTest() { assertEquals(returnedToast, sut.currentToast.value) sut.dismissCurrentToast() - assertEquals(offlineToast, sut.currentToast.value) + assertEquals(onlineToast, sut.currentToast.value) } @Test From dd4258f676d36dc5a8ec8d6b1ee13ed2d57e64c7 Mon Sep 17 00:00:00 2001 From: Ovi Trif Date: Wed, 25 Nov 2026 14:17:53 +0100 Subject: [PATCH 3/3] fix: show only the latest waiting connection status A queued toast is replaced by a newer one with the same key: connection toasts share one, and the address-type progress shares one with its result. Verified: just compile, just test, just lint --- app/src/main/java/to/bitkit/models/Toast.kt | 4 +- .../bitkit/ui/components/IsOnlineTracker.kt | 7 ++- .../AddressTypePreferenceViewModel.kt | 11 +++- .../bitkit/ui/shared/toast/ToastEventBus.kt | 4 +- .../ui/shared/toast/ToastQueueManager.kt | 8 +-- .../java/to/bitkit/viewmodels/AppViewModel.kt | 4 +- .../ui/shared/toast/ToastQueueManagerTest.kt | 57 +++++++++++++++++-- .../viewmodels/AppViewModelSendFlowTest.kt | 4 +- 8 files changed, 77 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/to/bitkit/models/Toast.kt b/app/src/main/java/to/bitkit/models/Toast.kt index 9243d5c349..fbead50460 100644 --- a/app/src/main/java/to/bitkit/models/Toast.kt +++ b/app/src/main/java/to/bitkit/models/Toast.kt @@ -10,8 +10,8 @@ data class Toast( val isLoading: Boolean = false, /** False for a one-time warning that later toasts wait behind instead of replacing. */ val interruptible: Boolean = true, - /** True for a progress toast that the next toast replaces, even while it waits in the queue. */ - val replacedByNext: Boolean = false, + /** A queued toast is replaced by a newer one with the same key, so only the latest status shows. */ + val replaceKey: String? = null, ) { enum class ToastType { SUCCESS, INFO, LIGHTNING, WARNING, ERROR } diff --git a/app/src/main/java/to/bitkit/ui/components/IsOnlineTracker.kt b/app/src/main/java/to/bitkit/ui/components/IsOnlineTracker.kt index fa70c67b10..98f610c284 100644 --- a/app/src/main/java/to/bitkit/ui/components/IsOnlineTracker.kt +++ b/app/src/main/java/to/bitkit/ui/components/IsOnlineTracker.kt @@ -12,6 +12,9 @@ import to.bitkit.models.Toast import to.bitkit.repositories.ConnectivityState import to.bitkit.viewmodels.AppViewModel +/** A connection status waiting behind another toast is replaced by the newer status. */ +private const val CONNECTIVITY_TOAST_KEY = "Connectivity" + @Composable fun IsOnlineTracker( app: AppViewModel, @@ -34,6 +37,7 @@ fun IsOnlineTracker( type = Toast.ToastType.SUCCESS, title = resources.getString(R.string.other__connection_back_title), description = resources.getString(R.string.other__connection_back_msg), + replaceKey = CONNECTIVITY_TOAST_KEY, ) } @@ -42,8 +46,7 @@ fun IsOnlineTracker( type = Toast.ToastType.WARNING, title = resources.getString(R.string.other__connection_issue), description = resources.getString(R.string.other__connection_issue_explain), - // A warning still waiting behind another toast is out of date once the connection is back. - replacedByNext = true, + replaceKey = CONNECTIVITY_TOAST_KEY, ) } diff --git a/app/src/main/java/to/bitkit/ui/settings/advanced/AddressTypePreferenceViewModel.kt b/app/src/main/java/to/bitkit/ui/settings/advanced/AddressTypePreferenceViewModel.kt index d767199927..5206073c4e 100644 --- a/app/src/main/java/to/bitkit/ui/settings/advanced/AddressTypePreferenceViewModel.kt +++ b/app/src/main/java/to/bitkit/ui/settings/advanced/AddressTypePreferenceViewModel.kt @@ -33,6 +33,9 @@ import to.bitkit.repositories.WalletRepo import to.bitkit.ui.shared.toast.ToastEventBus import javax.inject.Inject +/** The progress toast waiting in the queue is replaced by its result. */ +private const val ADDRESS_TYPE_TOAST_KEY = "AddressType" + @HiltViewModel class AddressTypePreferenceViewModel @Inject constructor( @ApplicationContext private val context: Context, @@ -76,7 +79,7 @@ class AddressTypePreferenceViewModel @Inject constructor( title = context.getString(R.string.settings__addr_type__applying), autoHide = false, testTag = "AddressTypeApplyingToast", - replacedByNext = true, + replaceKey = ADDRESS_TYPE_TOAST_KEY, ) val currentMonitored = _uiState.value.monitoredTypes.toMutableSet() @@ -100,12 +103,14 @@ class AddressTypePreferenceViewModel @Inject constructor( description = context.getString(R.string.settings__addr_type__now_using) .replace("{type}", typeName), testTag = "AddressTypeSettingsUpdatedToast", + replaceKey = ADDRESS_TYPE_TOAST_KEY, ) } else { ToastEventBus.send( type = Toast.ToastType.WARNING, title = context.getString(R.string.common__error), description = result.exceptionOrNull()?.message, + replaceKey = ADDRESS_TYPE_TOAST_KEY, ) } } @@ -123,7 +128,7 @@ class AddressTypePreferenceViewModel @Inject constructor( type = Toast.ToastType.INFO, title = context.getString(R.string.settings__addr_type__applying), autoHide = false, - replacedByNext = true, + replaceKey = ADDRESS_TYPE_TOAST_KEY, ) val repoResult = lightningRepo.setMonitoring(addressType, enabled) @@ -138,12 +143,14 @@ class AddressTypePreferenceViewModel @Inject constructor( ToastEventBus.send( type = Toast.ToastType.SUCCESS, title = context.getString(R.string.settings__addr_type__settings_updated), + replaceKey = ADDRESS_TYPE_TOAST_KEY, ) } else { ToastEventBus.send( type = Toast.ToastType.WARNING, title = context.getString(R.string.common__error), description = monitoringErrorMessage(repoResult.exceptionOrNull()?.message), + replaceKey = ADDRESS_TYPE_TOAST_KEY, ) } } diff --git a/app/src/main/java/to/bitkit/ui/shared/toast/ToastEventBus.kt b/app/src/main/java/to/bitkit/ui/shared/toast/ToastEventBus.kt index 22fc69a08d..de153c531e 100644 --- a/app/src/main/java/to/bitkit/ui/shared/toast/ToastEventBus.kt +++ b/app/src/main/java/to/bitkit/ui/shared/toast/ToastEventBus.kt @@ -15,7 +15,7 @@ object ToastEventBus { autoHide: Boolean = true, visibilityTime: Long = Toast.VISIBILITY_TIME_DEFAULT, testTag: String? = null, - replacedByNext: Boolean = false, + replaceKey: String? = null, interruptible: Boolean = true, ) { _events.emit( @@ -27,7 +27,7 @@ object ToastEventBus { visibilityTime = visibilityTime, testTag = testTag, interruptible = interruptible, - replacedByNext = replacedByNext, + replaceKey = replaceKey, ) ) } diff --git a/app/src/main/java/to/bitkit/ui/shared/toast/ToastQueueManager.kt b/app/src/main/java/to/bitkit/ui/shared/toast/ToastQueueManager.kt index 5c1401d64f..cb02941352 100644 --- a/app/src/main/java/to/bitkit/ui/shared/toast/ToastQueueManager.kt +++ b/app/src/main/java/to/bitkit/ui/shared/toast/ToastQueueManager.kt @@ -38,9 +38,9 @@ class ToastQueueManager(private val scope: CoroutineScope) { /** * Add toast to queue. If queue is full, drops oldest. A shown or queued loading toast returns after the new one, - * and a shown toast that is not interruptible stays until it hides. A queued progress toast is replaced by the new - * one, as it would have been on screen. A toast that is not interruptible and already shown or queued is not added - * again. + * and a shown toast that is not interruptible stays until it hides. A queued toast is replaced by a new one with + * the same key, as it would have been on screen. A toast that is not interruptible and already shown or queued is + * not added again. */ fun enqueue(toast: Toast) { if (!toast.interruptible && (toast == _currentToast.value || toast in _queue.value)) return @@ -49,7 +49,7 @@ class ToastQueueManager(private val scope: CoroutineScope) { _queue.update { current -> val (loading, others) = current.partition { it.isLoading } // Drop oldest when queue full - val waiting = others.filterNot { it.replacedByNext } + val waiting = others.filterNot { it.replaceKey != null && it.replaceKey == toast.replaceKey } (waiting + toast + loading + listOfNotNull(interruptedLoading)).takeLast(MAX_QUEUE_SIZE) } if (isCurrentInterruptible) dismissCurrentToast() diff --git a/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt b/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt index 37c119b471..87230dfbb4 100644 --- a/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt +++ b/app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt @@ -9355,7 +9355,7 @@ class AppViewModel @Inject constructor( autoHide: Boolean = true, visibilityTime: Long = Toast.VISIBILITY_TIME_DEFAULT, testTag: String? = null, - replacedByNext: Boolean = false, + replaceKey: String? = null, ) { toastManager.enqueue( Toast( @@ -9365,7 +9365,7 @@ class AppViewModel @Inject constructor( autoHide = autoHide, visibilityTime = visibilityTime, testTag = testTag, - replacedByNext = replacedByNext, + replaceKey = replaceKey, ) ) } diff --git a/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt b/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt index 07079d3347..3f83aed08c 100644 --- a/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt +++ b/app/src/test/java/to/bitkit/ui/shared/toast/ToastQueueManagerTest.kt @@ -58,9 +58,14 @@ class ToastQueueManagerTest : BaseUnitTest() { type = Toast.ToastType.INFO, title = "Applying changes", autoHide = false, - replacedByNext = true, + replaceKey = "AddressType", + ) + val resultToast = Toast( + type = Toast.ToastType.SUCCESS, + title = "Settings updated", + autoHide = true, + replaceKey = "AddressType", ) - val resultToast = Toast(type = Toast.ToastType.SUCCESS, title = "Settings updated", autoHide = true) sut.enqueue(updateToast) sut.enqueue(progressToast) sut.enqueue(resultToast) @@ -81,9 +86,14 @@ class ToastQueueManagerTest : BaseUnitTest() { type = Toast.ToastType.INFO, title = "Applying changes", autoHide = false, - replacedByNext = true, + replaceKey = "AddressType", + ) + val resultToast = Toast( + type = Toast.ToastType.SUCCESS, + title = "Settings updated", + autoHide = true, + replaceKey = "AddressType", ) - val resultToast = Toast(type = Toast.ToastType.SUCCESS, title = "Settings updated", autoHide = true) sut.enqueue(updateToast) sut.enqueue(onlineToast) sut.enqueue(progressToast) @@ -129,9 +139,14 @@ class ToastQueueManagerTest : BaseUnitTest() { type = Toast.ToastType.WARNING, title = "Offline", autoHide = true, - replacedByNext = true, + replaceKey = "Connectivity", + ) + val onlineToast = Toast( + type = Toast.ToastType.SUCCESS, + title = "Back online", + autoHide = true, + replaceKey = "Connectivity", ) - val onlineToast = Toast(type = Toast.ToastType.SUCCESS, title = "Back online", autoHide = true) sut.enqueue(returnedToast) sut.enqueue(offlineToast) @@ -143,6 +158,36 @@ class ToastQueueManagerTest : BaseUnitTest() { assertEquals(onlineToast, sut.currentToast.value) } + @Test + fun `only the latest connection status waits behind a toast that is not interruptible`() = test { + val sut = ToastQueueManager(backgroundScope) + val returnedToast = Toast( + type = Toast.ToastType.INFO, + title = "Payment returned", + autoHide = false, + interruptible = false, + ) + val offlineToast = Toast( + type = Toast.ToastType.WARNING, + title = "Offline", + autoHide = true, + replaceKey = "Connectivity", + ) + val onlineToast = offlineToast.copy(type = Toast.ToastType.SUCCESS, title = "Back online") + val resultToast = Toast(type = Toast.ToastType.SUCCESS, title = "Settings updated", autoHide = true) + sut.enqueue(returnedToast) + + sut.enqueue(offlineToast) + sut.enqueue(onlineToast) + sut.enqueue(offlineToast.copy(description = "Again")) + sut.enqueue(resultToast) + sut.dismissCurrentToast() + + assertEquals(offlineToast.copy(description = "Again"), sut.currentToast.value) + advanceTimeBy(Toast.VISIBILITY_TIME_DEFAULT + 1) + assertEquals(resultToast, sut.currentToast.value) + } + @Test fun `a toast that is not interruptible is shown once when sent twice`() = test { val sut = ToastQueueManager(backgroundScope) diff --git a/app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt b/app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt index 8ecfc6cdf2..cc915e0ee2 100644 --- a/app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt +++ b/app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt @@ -1134,12 +1134,12 @@ class AppViewModelSendFlowTest : BaseUnitTest() { } @Test - fun `a sent toast reaches the queue with its progress flag`() = test { + fun `a sent toast reaches the queue with its replace key`() = test { val progressToast = Toast( type = Toast.ToastType.INFO, title = "Applying changes", autoHide = false, - replacedByNext = true, + replaceKey = "AddressType", ) clearInvocations(toastManager)