Skip to content

[Repo Assist] fix: refresh channel list when channels are added/removed on gateway - #57

Merged
shanselman merged 1 commit into
masterfrom
repo-assist/fix-channel-refresh-55-eddad905e7b76999
Mar 17, 2026
Merged

shanselman merged 1 commit into
masterfrom
repo-assist/fix-channel-refresh-55-eddad905e7b76999

Conversation

@shanselman

Copy link
Copy Markdown
Collaborator

Fixes two bugs that together caused issue #55.

Root causes:

  1. Empty channel list suppressed in ParseChannelHealth — the \if (healthList.Count > 0)\ guard prevented \ChannelHealthUpdated\ from firing when the gateway returned an empty channel map, so removing the last channel never cleared the UI.

  2. Open StatusDetailWindow not refreshed on channel update — _lastChannels\ was updated but an already-open \StatusDetailWindow\ was never pushed the updated list.

Fix:

  • Remove the count guard so \ChannelHealthUpdated\ always fires
  • Dispatch \StatusDetailWindow.UpdateStatus\ when the window is open

Tests: 3 new unit tests covering channel health parsing. 478/478 shared tests pass.

Closes #55

Two bugs prevented #55 from working correctly:

1. ParseChannelHealth (OpenClawGatewayClient) suppressed ChannelHealthUpdated
   when the gateway returned an empty channel object. This meant removing the
   last channel never cleared _lastChannels in the UI.

2. OnChannelHealthUpdated (App.xaml.cs) updated _lastChannels but never pushed
   the new list to an open StatusDetailWindow, so the window showed stale
   channel data until the user closed and reopened it.

Fix:
- Remove the 'if (healthList.Count > 0)' guard so ChannelHealthUpdated always
  fires, even when all channels have been removed.
- In OnChannelHealthUpdated, enqueue a StatusDetailWindow.UpdateStatus call on
  the dispatcher so an already-open status window reflects channel changes
  immediately.

Also adds three unit tests covering the channel health parsing path.

Closes #55

Co-authored-by: Copilot <[email protected]>
@shanselman
shanselman merged commit 4549b62 into master Mar 17, 2026
7 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 18, 2026
36 tasks
@vincentkoc
vincentkoc deleted the repo-assist/fix-channel-refresh-55-eddad905e7b76999 branch August 2, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Channel list doesn't refresh when channels are removed/added on gateway

1 participant