Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/src/store/connectivitySlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ const slice = createSlice({
},
setBackend(state, action: PayloadAction<{ value: BackendState; error?: string }>) {
state.backend = action.payload.value;
if (action.payload.value === 'connected') {
if (action.payload.value === 'connected' || action.payload.value === 'connecting') {
// Clear the stale error on both successful connection and reconnect
// attempts. Previously only 'connected' deleted lastError.backend,
// which meant a prior disconnect error (e.g. "transport close") was
// left set to `undefined` — not deleted — during 'connecting'. UI
// components that read lastError.backend could still surface a stale
// message in the reconnect window even though the key appeared falsy.
delete state.lastError.backend;
} else {
state.lastError.backend = action.payload.error;
Expand Down
Loading