Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .changeset/7907-manage-snapshot-refresh-reports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
'@object-ui/app-shell': patch
---

Studio: a failed managed-snapshot refresh no longer leaves the package sheet showing
the pre-action record as current (objectui#7907).

`onManageChanged` runs after every package lifecycle action fired from the detail sheet
(disable / enable / duplicate / publish / publish-drafts / manifest edit). Its tail
re-read the managed record so the change would show immediately, and swallowed any
failure under a bare `catch {}` commented "keep the current snapshot" — a snapshot the
action itself had just made stale. The author disabled a package, was told nothing, and
went on reading `Status: Enabled`.

The sheet derives its lifecycle verb from that record (`enabled` picks both the button's
label and the endpoint it POSTs), so a stale snapshot did not merely display a stale
badge — it re-armed the author with the verb they had just fired. The failure is now
reported through this surface's existing posture (`formatMetadataError` on the shared
`studio-package-list` sonner id, so one outage across the surface is still one toast)
and the sheet closes rather than stay open on a record known to be pre-action. The
Studio, the top bar and the package list are untouched: still a degradation, never a
throw, and no navigation is inferred from a refresh that could not happen.

The same tail dropped `fresh === null` — a successful read whose list no longer contains
the package — just as quietly; it now reports that with the same sentence `openManage`
already uses for it.

Pre-existing, and objectui#7881 made it much easier to hit rather than causing it:
before that fix `fetchFullPackage` never read `res.ok`, so this `catch` could only ever
see a non-JSON body; now that the helper refuses a non-2xx, the same `catch` was also
swallowing every 401 / 403 / 503 / 500.
9 changes: 9 additions & 0 deletions packages/app-shell/src/views/metadata-admin/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,13 @@ const ENGINE_STRINGS_EN: Record<string, string> = {
// list; the sheet is not opened, and this says so instead of nothing.
'engine.studio.pkg.manageMissing':
'Package {id} is not in the installed list — it may have been deleted or uninstalled elsewhere.',
// objectui#7907 — the managed-snapshot refresh that follows a lifecycle
// action failed. The sheet is an ACTION surface whose verb is derived from
// the record it holds, so it is closed rather than left re-armed with the
// pre-action one; this names that consequence and carries the server's own
// words inside it (one report, on the shared sonner id).
'engine.studio.pkg.manageRefreshFailed':
'Package {id} could not be refreshed after that change — closing the panel rather than showing the pre-change record as current. {error}',
'engine.studio.data.savedDraft': 'Object “{label}” saved as draft',
'engine.studio.data.lastSaved': 'Saved {time}',
'engine.studio.publish': 'Publish',
Expand Down Expand Up @@ -3390,6 +3397,8 @@ const ENGINE_STRINGS_ZH: Record<string, string> = {
'engine.studio.access.idLabel': '标识',
'engine.studio.pkg.manage': '软件包信息与设置',
'engine.studio.pkg.manageMissing': '软件包 {id} 不在已安装列表中 —— 可能已在别处被删除或卸载。',
'engine.studio.pkg.manageRefreshFailed':
'软件包 {id} 在该操作后未能刷新 —— 已关闭面板,以免把操作前的记录当作最新呈现。{error}',
'engine.studio.data.savedDraft': '对象「{label}」已存为草稿',
'engine.studio.data.lastSaved': '已于 {time} 保存',
'engine.studio.publish': '发布',
Expand Down
Loading
Loading