fix: pop old AND new name from health cache on rename (#36)
Closes #36 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2083,12 +2083,17 @@ class MainWindow(QMainWindow):
|
|||||||
if not (0 <= idx < len(self.servers)):
|
if not (0 <= idx < len(self.servers)):
|
||||||
return
|
return
|
||||||
entry = self.servers[idx]
|
entry = self.servers[idx]
|
||||||
|
old_name = entry.name
|
||||||
entry.name = self.editor.current_name()
|
entry.name = self.editor.current_name()
|
||||||
entry.data = self.editor.dump_data()
|
entry.data = self.editor.dump_data()
|
||||||
# The server stays in its section (enable state unchanged), so update
|
# The server stays in its section (enable state unchanged), so update
|
||||||
# its existing row in place rather than re-rendering.
|
# its existing row in place rather than re-rendering.
|
||||||
# An edit invalidates any cached "Test all" result -- the server that
|
# An edit invalidates any cached "Test all" result -- the server that
|
||||||
# was spawn-tested no longer matches what's on disk once saved.
|
# was spawn-tested no longer matches what's on disk once saved. Pop
|
||||||
|
# both names: the old one (so a rename doesn't leave a stale entry
|
||||||
|
# for whoever takes that name next) and the new one (so we don't
|
||||||
|
# inherit a stale result cached under the name being renamed to).
|
||||||
|
self._health.pop(old_name, None)
|
||||||
self._health.pop(entry.name, None)
|
self._health.pop(entry.name, None)
|
||||||
loc = self._row_of_index.get(idx)
|
loc = self._row_of_index.get(idx)
|
||||||
if loc:
|
if loc:
|
||||||
|
|||||||
Reference in New Issue
Block a user