From 622eaafe367c1d710f729d6d8d9134c8e604bcb2 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Fri, 31 Jul 2026 14:53:52 -0700 Subject: [PATCH] fix(runtime): dismiss intentional outage toast --- .../src/store/slices/runtime-status.test.ts | 17 +++++++++++++++++ src/renderer/src/store/slices/runtime-status.ts | 11 ++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/store/slices/runtime-status.test.ts b/src/renderer/src/store/slices/runtime-status.test.ts index 2950a63115e..5c98aa9cc47 100644 --- a/src/renderer/src/store/slices/runtime-status.test.ts +++ b/src/renderer/src/store/slices/runtime-status.test.ts @@ -256,6 +256,23 @@ describe('runtime-status slice', () => { expect(store.getState().runtimeStatusByEnvironmentId.get('env-a')?.status).toBeNull() }) + it('dismisses an outage toast opened while an intentional disconnect was pending', () => { + const store = createSliceStore() + store.getState().setRuntimeEnvironmentStatus('env-a', { status: makeStatus(), checkedAt: 1 }) + store.getState().setRuntimeEnvironmentStatus('env-a', { status: null, checkedAt: 2 }) + + store + .getState() + .setRuntimeEnvironmentStatus( + 'env-a', + { status: null, checkedAt: 3 }, + { suppressDisconnectToast: true } + ) + + expect(toast.warning).toHaveBeenCalledTimes(1) + expect(toast.dismiss).toHaveBeenCalledWith('runtime-environment-disconnected:env-a') + }) + it('clears a single environment entry', () => { const store = createSliceStore() store.getState().setRuntimeEnvironmentStatus('env-a', { status: makeStatus(), checkedAt: 1 }) diff --git a/src/renderer/src/store/slices/runtime-status.ts b/src/renderer/src/store/slices/runtime-status.ts index 1c7ff9a60ac..281a8a6da18 100644 --- a/src/renderer/src/store/slices/runtime-status.ts +++ b/src/renderer/src/store/slices/runtime-status.ts @@ -251,14 +251,11 @@ export const createRuntimeStatusSlice: StateCreator