fix: Harden instance rename against interleaving and lost unwinds

This commit is contained in:
2026-08-12 11:08:36 +00:00
parent f534b74066
commit cdc50b7aaf
10 changed files with 220 additions and 64 deletions
@@ -213,7 +213,15 @@ export default function InstancePage() {
The instance name is where its address comes from. Renaming moves it to a new address and releases the old
one, so saved links and bookmarks to it stop working.
</p>
{/*
* Keyed on the instance: this element stays mounted
* across a navigation between two instance pages, so
* without a key the success note and the typed name
* from one instance surface on the next.
*/}
<RenamePanel
key={instance.instance_id}
movesHost
currentName={instance.name}
currentSlug={instance.slug ?? ""}
onRename={async (name) => {
@@ -87,7 +87,14 @@ export default function StaffInstancePage() {
* hours.
*/}
<Panel title="Name" meta={data.instance.deployment === "cloud" ? "Moves the address" : "Label only"}>
{/*
* Keyed on the instance so a success note cannot follow staff
* from one instance page to the next — the element stays
* mounted across that navigation.
*/}
<RenamePanel
key={data.instance.instance_id}
movesHost={data.instance.deployment === "cloud" && !data.instance.placeholder}
currentName={data.instance.name}
currentSlug={data.instance.slug ?? ""}
onRename={async (name) => {