Health cache keyed by server name: renames leave stale entries and can pin wrong health to a reused name #36
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.