Skip to content

fix: tolerate missing Mihomo proxy members - #41

Closed
d0zingcat wants to merge 2 commits into
George-Miao:masterfrom
d0zingcat:fix/mihomo-missing-proxy-members
Closed

d0zingcat wants to merge 2 commits into
George-Miao:masterfrom
d0zingcat:fix/mihomo-missing-proxy-members

Conversation

@d0zingcat

Copy link
Copy Markdown

Summary

Mihomo can occasionally return a policy group whose all list references proxies omitted from the /proxies response. The TUI previously assumed those members were always present and panicked while building the proxy tree.

This change makes the proxy tree resilient to that inconsistent runtime response:

  • skip group members that are absent from /proxies
  • leave the group unselected when its reported current member is unavailable
  • omit groups with no remaining members, preventing empty-list expansion panics
  • add regression coverage for missing members, missing current nodes, empty groups, and normal selection

Verification

  • rustfmt --check clashctl/src/ui/components/proxy/tree.rs
  • cargo +stable test -p clashctl ui::components::proxy::tree::tests
  • cargo +stable build --release
  • Opened the TUI successfully against a live Mihomo controller

Notes

The repository currently uses a floating nightly toolchain that is incompatible with its locked io-lifetimes 0.7.3 dependency. The checks above were run with the installed stable toolchain; no toolchain or dependency changes are included in this PR.

@d0zingcat d0zingcat closed this Sep 11, 2026
@d0zingcat
d0zingcat deleted the fix/mihomo-missing-proxy-members branch September 11, 2026 04:36
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.

1 participant