You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found while fixing objectui#7368 (the PackageSwitcher fetch error posture). Deliberately not fixed there: that card is about the switcher's silence, this one is about a wrong
decision the same silence hides, and the correct behaviour needs a ruling rather than a
one-line toast.
onManageChanged in packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx
(:340-354 on origin/main900f8d995) — the callback the PackageDetailSheet fires after any
package lifecycle action (disable / duplicate / delete / publish / manifest edit):
const onManageChanged = React.useCallback(async () => {
let list: PkgEntry[] = [];
try {
list = await fetchPackages();
setPkgs(list);
} catch {
/* keep the stale list */
}
const managedId = manage?.manifest.id;
if (!managedId) return;
if (!list.some((p) => p.id === managedId)) {
// Deleted — only navigate away if it was the package we're editing.
if (managedId === packageId) {
const next = list[0];
navigate(next ? `/studio/${encodeURIComponent(next.id)}/${tab}` : '/home');
}
return;
}
...
The catch comment says "keep the stale list". That is true of the pkgsstate — which is
simply not written — but not of the local list, which was initialised to [] and stays []. Three lines later !list.some(...) is therefore always true, so a failed refresh takes
the branch labelled // Deleted. If the managed package is the one under the editor, the surface
navigates away: list[0] is undefined, so the destination is /home.
Net effect: a transient failure of GET /api/v1/packages — a 503 from the durable half, a
network blip, an auth expiry — immediately after any package lifecycle action reads as "your
package was deleted" and silently evicts the author from the Studio editor to the home page.
No toast, no confirmation, and the package is still there.
The .catch is the same shape objectui#7368 is about, and this is the fourth call site named in
that card's triage. The other three are handled in the PR for #7368; this one is held back
because a toast alone would leave the eviction firing.
Worth deciding
Skip the eviction check when the refresh failed — treat "I could not find out" as "no
information", not as "gone". Cheapest, and matches the sibling catch two blocks down
(/* keep the current snapshot */), which already declines to act on a failure.
Re-derive from the state list rather than the local [], so a failed refresh falls back
to what the switcher last knew.
grep -n "onManageChanged" -A 20 packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx
Related, not a duplicate: objectui#7373 is about the destination of recovery redirects
(hard-coded /home vs the declared landing page). This card is about the redirect firing at all,
on a false premise.
Observation
Found while fixing objectui#7368 (the
PackageSwitcherfetch error posture). Deliberatelynot fixed there: that card is about the switcher's silence, this one is about a wrong
decision the same silence hides, and the correct behaviour needs a ruling rather than a
one-line toast.
onManageChangedinpackages/app-shell/src/views/studio-design/StudioDesignSurface.tsx(
:340-354onorigin/main900f8d995) — the callback thePackageDetailSheetfires after anypackage lifecycle action (disable / duplicate / delete / publish / manifest edit):
The
catchcomment says "keep the stale list". That is true of thepkgsstate — which issimply not written — but not of the local
list, which was initialised to[]and stays[]. Three lines later!list.some(...)is therefore always true, so a failed refresh takesthe branch labelled
// Deleted. If the managed package is the one under the editor, the surfacenavigates away:
list[0]is undefined, so the destination is/home.Net effect: a transient failure of
GET /api/v1/packages— a 503 from the durable half, anetwork blip, an auth expiry — immediately after any package lifecycle action reads as "your
package was deleted" and silently evicts the author from the Studio editor to the home page.
No toast, no confirmation, and the package is still there.
The
.catchis the same shape objectui#7368 is about, and this is the fourth call site named inthat card's triage. The other three are handled in the PR for #7368; this one is held back
because a toast alone would leave the eviction firing.
Worth deciding
information", not as "gone". Cheapest, and matches the sibling
catchtwo blocks down(
/* keep the current snapshot */), which already declines to act on a failure.[], so a failed refresh falls backto what the switcher last knew.
Re-check
Related, not a duplicate: objectui#7373 is about the destination of recovery redirects
(hard-coded
/homevs the declared landing page). This card is about the redirect firing at all,on a false premise.
Generated by Claude Code