MainWindow._health maps server name → (status, summary). Two problems:
_editor_changed() (bcc.py ~L2043) pops entry.nameafter assigning the new name from the editor — so on a rename it pops the new name (usually a no-op) and the old name's cached health stays in _health forever. If any server is later given that old name, it inherits a stale health dot from a different server.
_update_health_cell() resolves by next(i for … if s.name == name); with duplicate names mid-edit (validation blocks save but not the in-memory state), results attach to the wrong row.
Proposed fix: capture the old name before reassigning (old = entry.name) and pop that; or key the cache by object identity (id(entry))/master index and rebuild on load. Keep the existing behavior that an edit invalidates the entry's health.
Acceptance: rename a tested server → its old name no longer appears in _health; renaming another server to the freed name shows UNTESTED, not the previous server's result. Unit-testable if the cache logic is extracted; otherwise cover via a small GUI-free helper.
**Found in audit of `main` @ 06326e5.**
`MainWindow._health` maps **server name → (status, summary)**. Two problems:
1. `_editor_changed()` (`bcc.py` ~L2043) pops `entry.name` **after** assigning the new name from the editor — so on a rename it pops the *new* name (usually a no-op) and the *old* name's cached health stays in `_health` forever. If any server is later given that old name, it inherits a stale health dot from a different server.
2. `_update_health_cell()` resolves by `next(i for … if s.name == name)`; with duplicate names mid-edit (validation blocks save but not the in-memory state), results attach to the wrong row.
**Proposed fix**: capture the old name before reassigning (`old = entry.name`) and pop that; or key the cache by object identity (`id(entry)`)/master index and rebuild on load. Keep the existing behavior that an edit invalidates the entry's health.
**Acceptance**: rename a tested server → its old name no longer appears in `_health`; renaming another server to the freed name shows UNTESTED, not the previous server's result. Unit-testable if the cache logic is extracted; otherwise cover via a small GUI-free helper.
the_og
added the P2 label 2026-07-12 12:44:48 -04:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found in audit of
main@06326e5.MainWindow._healthmaps server name → (status, summary). Two problems:_editor_changed()(bcc.py~L2043) popsentry.nameafter assigning the new name from the editor — so on a rename it pops the new name (usually a no-op) and the old name's cached health stays in_healthforever. If any server is later given that old name, it inherits a stale health dot from a different server._update_health_cell()resolves bynext(i for … if s.name == name); with duplicate names mid-edit (validation blocks save but not the in-memory state), results attach to the wrong row.Proposed fix: capture the old name before reassigning (
old = entry.name) and pop that; or key the cache by object identity (id(entry))/master index and rebuild on load. Keep the existing behavior that an edit invalidates the entry's health.Acceptance: rename a tested server → its old name no longer appears in
_health; renaming another server to the freed name shows UNTESTED, not the previous server's result. Unit-testable if the cache logic is extracted; otherwise cover via a small GUI-free helper.