diff --git a/.changeset/34860-app-set-default-restore.md b/.changeset/34860-app-set-default-restore.md new file mode 100644 index 00000000000..e0562596125 --- /dev/null +++ b/.changeset/34860-app-set-default-restore.md @@ -0,0 +1,13 @@ +--- +'@object-ui/console': patch +'@object-ui/i18n': patch +--- + +fix(console): a refused "Set as default" on Setup › Apps no longer leaves the deployment with no default app + +Clause-②: no +Metadata-protocol: none + +Setting an app as the default first un-sets the current default, then sets the new one. When the second write was refused (for example, the app belongs to a read-only package and the server answers 403), the first write stayed and no app was the default any more. Now, when the server refuses the write (a 4xx answer) or the write fails before it is sent, the page puts each un-set default back, in the package it came from, before it shows the refusal. So a refused set-default leaves the default where it was. If putting it back fails too, a second error names the app that is no longer the default (new key `appManagement.toast.restoreDefaultFailed`, in all eleven console locales). A failure the server did not answer, or a 5xx, may have been written, so it is not undone: the page shows the failure and re-reads the list, which shows the result. + +Nothing to migrate. diff --git a/ui/apps/console/src/pages/system/AppManagementPage.tsx b/ui/apps/console/src/pages/system/AppManagementPage.tsx index 0c2d61febab..660f5dcad74 100644 --- a/ui/apps/console/src/pages/system/AppManagementPage.tsx +++ b/ui/apps/console/src/pages/system/AppManagementPage.tsx @@ -71,6 +71,18 @@ * row shows the state the server serves. No row is patched locally ahead of * that read. * + * ## A refused set-default leaves the default where it was (objectstack#34860) + * + * Set default demotes the outgoing default before it promotes the target. + * When the promote is then refused with a 4xx (a target in a read-only package + * answers 403), or fails before it is sent, it wrote nothing, so each demotion + * that landed is put back in its own package scope before the refusal is + * shown, and the deployment keeps the default it had. A restore that fails too + * gets its own error toast naming the app that is no longer the default. A + * failure the server did not answer (or a 5xx) may have been written, so it is + * not undone: restoring could leave two defaults, and the re-read shows the + * result. + * * ## A disabled star says why (ux-conventions.disabled-control-reason) * * The default app's Set-default star is disabled, and it gives its reason, @@ -155,6 +167,31 @@ function owningPackage(app: { _packageId?: unknown }): string | undefined { : undefined; } +/** + * The failures `saveApp` raises BEFORE its write is sent: nothing reached the + * server, so nothing was written. + */ +const UNWRITTEN = new WeakSet(); + +function markUnwritten(e: unknown): Error { + const error = e instanceof Error ? e : new Error(String(e ?? '')); + UNWRITTEN.add(error); + return error; +} + +/** + * Whether a failed save is KNOWN to have written nothing: it failed before its + * write was sent, or the server answered it with a 4xx refusal (the client + * puts the status on `httpStatus`). A failure with no answer (a dropped + * connection, a timeout) or a 5xx may have been written anyway, so it is not. + */ +function wroteNothing(e: unknown): boolean { + if (typeof e !== 'object' || e === null) return false; + if (UNWRITTEN.has(e)) return true; + const status = (e as { httpStatus?: unknown }).httpStatus; + return typeof status === 'number' && status >= 400 && status < 500; +} + /** * Save one app in the scope it is served from (objectui#12300), with the keys * one control owns changed. @@ -180,8 +217,13 @@ async function saveApp( patch: Record, ) { const packageId = owningPackage(app); - const stored = await readAuthored('app', app.name, packageId ? { packageId } : {}); - if (!stored) throw new Error(); + let stored: Record | null; + try { + stored = await readAuthored('app', app.name, packageId ? { packageId } : {}); + } catch (e: unknown) { + throw markUnwritten(e); + } + if (!stored) throw markUnwritten(new Error()); const body = { ...stored, ...patch }; return packageId ? meta.saveItem('app', app.name, body, { packageId }) @@ -398,14 +440,17 @@ export function AppManagementPage() { return; } setProcessing(true); + // The outgoing defaults whose demotion the server ACCEPTED, in order — the + // ones a failure further on must put back (objectstack#34860). + const demoted: any[] = []; try { // `isDefault` ROUTES (`resolveLandingPath` rule 1 takes the FIRST match), // so it is single-valued in effect but not by construction: leaving the // previous holder set would make the landing depend on the order the // server happens to list apps in. Demote first, promote second — that - // ordering is what makes a failure mid-way leave the deployment with NO - // default (falls through to `/home`, the documented rule-3 answer) rather - // than with two. + // ordering is what makes a failure mid-way never leave the deployment + // with two defaults. A refused write mid-way is then undone below, so it + // does not leave it with NONE either. const outgoing = (apps || []).filter( (a: any) => a?.isDefault === true && a.name !== app.name, ); @@ -413,6 +458,7 @@ export function AppManagementPage() { // the incoming one may belong to different packages, or to none. for (const prev of outgoing) { await saveApp(meta, readAuthored, prev, { isDefault: false }); + demoted.push(prev); } await saveApp(meta, readAuthored, app, { isDefault: true }); toast.success(t('appManagement.toast.setDefaultDone', { @@ -420,13 +466,43 @@ export function AppManagementPage() { name: appTitle(app), })); } catch (e: unknown) { + // objectstack#34860 — when the failed write is KNOWN to have written + // nothing (refused with a 4xx, e.g. 403 for a target in a read-only + // package, or failed before it was sent), every demotion that already + // landed is put back, each in the same package scope it was demoted in, + // so a refused set-default leaves the default where it was. The failed + // write changed nothing, so restoring cannot make two defaults. + // Any other failure (no answer, a 5xx) may have been written, so the + // promote may have landed and a restore could make two: nothing is + // undone, and the re-read below shows what the server holds. + const toRestore = wroteNothing(e) ? demoted : []; + const unrestored: any[] = []; + const restoreErrors: unknown[] = []; + for (const prev of toRestore) { + try { + await saveApp(meta, readAuthored, prev, { isDefault: true }); + } catch (restoreFailure: unknown) { + unrestored.push(prev); + restoreErrors.push(restoreFailure); + } + } toast.error(t('appManagement.toast.setDefaultFailed', { defaultValue: 'Failed to set default app: {{reason}}', reason: reason(e, unknownError), })); + if (unrestored.length > 0) { + // The restore failed too: the deployment is left without the default + // it had. Said, never hidden: the operator has to set one. Each app's + // reason is listed once; identical reasons are said once. + toast.error(t('appManagement.toast.restoreDefaultFailed', { + defaultValue: 'Could not restore {{name}} as the default app, so it is no longer the default: {{reason}}', + name: unrestored.map((a) => appTitle(a)).join(', '), + reason: [...new Set(restoreErrors.map((r) => reason(r, unknownError)))].join('; '), + })); + } } finally { - // Re-read on failure too: a failure after the demotion has already - // changed the server, and the list must show the deployment as it now is. + // Re-read on failure too: the list must show the deployment as it now + // is, restored or not. await refresh(); setProcessing(false); } diff --git a/ui/apps/console/src/pages/system/__tests__/AppManagementPage.honestWrites-12300.test.tsx b/ui/apps/console/src/pages/system/__tests__/AppManagementPage.honestWrites-12300.test.tsx index f2d663be2de..8ec18d89eeb 100644 --- a/ui/apps/console/src/pages/system/__tests__/AppManagementPage.honestWrites-12300.test.tsx +++ b/ui/apps/console/src/pages/system/__tests__/AppManagementPage.honestWrites-12300.test.tsx @@ -353,11 +353,11 @@ describe('Set default sends each app’s own package (objectui#12300)', () => { expect(card('lanebapp_app').queryByText('Default')).toBeNull(); }); - it('re-reads after a failure too: a demotion that landed is shown, not hidden', async () => { + it('re-reads after a failure too: the restored default is what the list shows', async () => { const realSave = h.saveItem.getMockImplementation()!; h.saveItem .mockImplementationOnce(realSave) - .mockRejectedValueOnce(new Error('forbidden: manage_metadata required')); + .mockRejectedValueOnce(Object.assign(new Error('forbidden: manage_metadata required'), { httpStatus: 403 })); const user = userEvent.setup(); renderPage(); @@ -366,8 +366,11 @@ describe('Set default sends each app’s own package (objectui#12300)', () => { await waitFor(() => expect(h.toastError).toHaveBeenCalled()); expect(h.toastSuccess).not.toHaveBeenCalled(); await waitFor(() => expect(h.refresh).toHaveBeenCalled()); - // The demotion landed and the promotion did not: no app is the default. - await waitFor(() => expect(screen.queryByText('Default')).toBeNull()); + // The demotion landed and the promotion did not, so the demotion was put + // back (objectstack#34860): the previous default is still the default. + expect(h.saveItem).toHaveBeenCalledTimes(3); + await waitFor(() => expect(card('lanebapp_app').getByText('Default')).toBeInTheDocument()); + expect(card('showcase_app').queryByText('Default')).toBeNull(); }); }); diff --git a/ui/apps/console/src/pages/system/__tests__/AppManagementPage.mutations.test.tsx b/ui/apps/console/src/pages/system/__tests__/AppManagementPage.mutations.test.tsx index c646a4ee108..598057242ad 100644 --- a/ui/apps/console/src/pages/system/__tests__/AppManagementPage.mutations.test.tsx +++ b/ui/apps/console/src/pages/system/__tests__/AppManagementPage.mutations.test.tsx @@ -36,7 +36,7 @@ * is the pair the stub was able to satisfy before. */ -import { describe, expect, it, vi, beforeEach } from 'vitest'; +import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'; import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { MemoryRouter } from 'react-router-dom'; @@ -182,6 +182,165 @@ describe('Set as default — issues a real mutation', () => { }); }); +/** + * objectstack#34860 — a refused set-default leaves the default where it was. + * + * The outgoing default lives in a writable package; the target lives in a + * read-only one, whose promote the server refuses with 403. Demote-first means + * the demotion has already landed by then, so the page must put it back, in the + * same package scope, or the deployment is left with no default app. + */ +describe('Set as default — a refused promote restores the previous default (objectstack#34860)', () => { + const MTHREE = { + name: 'mthree_app', + label: 'MThree', + isDefault: true, + _packageId: 'com.objectstack.qa.mthree', + }; + const SHOWCASE = { name: 'showcase_app', label: 'Showcase', _packageId: 'com.example.showcase' }; + const READ_ONLY = + "Cannot overlay 'app' in package 'com.example.showcase': that package is read-only"; + /** A refusal the server answered, in the shape the client throws: the status on `httpStatus`. */ + const refused = (message: string, httpStatus = 403) => Object.assign(new Error(message), { httpStatus }); + + /** Every write the page sent, with the package scope it named (the 4th argument). */ + const writes = () => + (saveItem.mock.calls as unknown[][]).map(([, name, body, options]) => [ + name, + (body as { isDefault?: boolean }).isDefault, + (options as { packageId?: string } | undefined)?.packageId, + ]); + + /** The `isDefault` each app holds after the writes that LANDED, over the listed state. */ + const landedDefaults = async () => { + const state: Record = Object.fromEntries( + apps.value.map((a: any) => [a.name, a.isDefault === true]), + ); + for (const [i, call] of (saveItem.mock.calls as unknown[][]).entries()) { + const outcome = saveItem.mock.results[i]; + // A rejected write is a settled promise that throws; only fulfilled ones landed. + const landed = await Promise.resolve(outcome?.value).then(() => true, () => false); + if (landed) state[call[1] as string] = (call[2] as { isDefault?: boolean }).isDefault === true; + } + return Object.keys(state).filter((name) => state[name]); + }; + + beforeEach(() => { + apps.value = [MTHREE, SHOWCASE]; + }); + + // `clearAllMocks` keeps an implementation, so the refusals below are undone + // here rather than leaking into the describes that follow. + afterEach(() => { + saveItem.mockImplementation(async () => ({})); + }); + + it('re-promotes the demoted default in its own package, and the final writes leave the same default', async () => { + saveItem.mockImplementation(async (_type, name, item) => { + if (name === 'showcase_app' && item.isDefault === true) throw refused(READ_ONLY); + return {}; + }); + const user = userEvent.setup(); + renderPage(); + + await user.click(screen.getByLabelText('Set Showcase as default')); + + await waitFor(() => expect(refresh).toHaveBeenCalled()); + expect(writes()).toEqual([ + ['mthree_app', false, 'com.objectstack.qa.mthree'], + ['showcase_app', true, 'com.example.showcase'], + ['mthree_app', true, 'com.objectstack.qa.mthree'], + ]); + expect(await landedDefaults()).toEqual(['mthree_app']); + // The original refusal is what the operator is told, in the server's words. + expect(toastError).toHaveBeenCalledTimes(1); + expect(toastError.mock.calls[0][0]).toContain(READ_ONLY); + expect(toastSuccess).not.toHaveBeenCalled(); + }); + + it('⛔ says so when the restore is refused too — the lost default is never hidden', async () => { + saveItem.mockImplementation(async (_type, name, item) => { + if (name === 'showcase_app' && item.isDefault === true) throw refused(READ_ONLY); + if (name === 'mthree_app' && item.isDefault === true) throw refused('restore refused'); + return {}; + }); + const user = userEvent.setup(); + renderPage(); + + await user.click(screen.getByLabelText('Set Showcase as default')); + + await waitFor(() => expect(refresh).toHaveBeenCalled()); + expect(writes()).toEqual([ + ['mthree_app', false, 'com.objectstack.qa.mthree'], + ['showcase_app', true, 'com.example.showcase'], + ['mthree_app', true, 'com.objectstack.qa.mthree'], + ]); + expect(await landedDefaults()).toEqual([]); + expect(toastError).toHaveBeenCalledTimes(2); + expect(toastError.mock.calls[0][0]).toContain(READ_ONLY); + // The second error names the app that is no longer the default, and why. + expect(toastError.mock.calls[1][0]).toContain('MThree'); + expect(toastError.mock.calls[1][0]).toContain('restore refused'); + expect(toastSuccess).not.toHaveBeenCalled(); + }); + + it('a refused demotion writes nothing more — there is nothing to restore', async () => { + saveItem.mockImplementation(async (_type, name) => { + if (name === 'mthree_app') throw refused('forbidden'); + return {}; + }); + const user = userEvent.setup(); + renderPage(); + + await user.click(screen.getByLabelText('Set Showcase as default')); + + await waitFor(() => expect(refresh).toHaveBeenCalled()); + expect(writes()).toEqual([['mthree_app', false, 'com.objectstack.qa.mthree']]); + expect(await landedDefaults()).toEqual(['mthree_app']); + expect(toastError).toHaveBeenCalledTimes(1); + }); + + // A failure the server did not answer, or a 5xx, may have been written: the + // promote may have landed, so a restore could leave TWO defaults. Nothing is + // undone; the re-read shows what the server holds. + it.each([ + ['no answer (no httpStatus)', () => new TypeError('Failed to fetch')], + ['a 5xx', () => refused('upstream timeout', 504)], + ])('⛔ a promote failure with %s sends no restore write', async (_label, failure) => { + saveItem.mockImplementation(async (_type, name, item) => { + if (name === 'showcase_app' && item.isDefault === true) throw failure(); + return {}; + }); + const user = userEvent.setup(); + renderPage(); + + await user.click(screen.getByLabelText('Set Showcase as default')); + + await waitFor(() => expect(refresh).toHaveBeenCalled()); + expect(writes()).toEqual([ + ['mthree_app', false, 'com.objectstack.qa.mthree'], + ['showcase_app', true, 'com.example.showcase'], + ]); + expect(toastError).toHaveBeenCalledTimes(1); + expect(toastSuccess).not.toHaveBeenCalled(); + }); + + it('CONTROL: an accepted promote keeps the order demote → promote, with no restore write', async () => { + const user = userEvent.setup(); + renderPage(); + + await user.click(screen.getByLabelText('Set Showcase as default')); + + await waitFor(() => expect(toastSuccess).toHaveBeenCalled()); + expect(writes()).toEqual([ + ['mthree_app', false, 'com.objectstack.qa.mthree'], + ['showcase_app', true, 'com.example.showcase'], + ]); + expect(await landedDefaults()).toEqual(['showcase_app']); + expect(toastError).not.toHaveBeenCalled(); + }); +}); + describe('Disable / Enable — issues a real mutation', () => { it('PUTs `active: false` when disabling an active app', async () => { const user = userEvent.setup(); diff --git a/ui/packages/i18n/src/locales/ar.ts b/ui/packages/i18n/src/locales/ar.ts index 403a139aff3..73f8d478bda 100644 --- a/ui/packages/i18n/src/locales/ar.ts +++ b/ui/packages/i18n/src/locales/ar.ts @@ -6099,6 +6099,7 @@ const ar = { toggleFailed: "فشل تغيير حالة التطبيق: {{reason}}", setDefaultDone: "تم تعيين {{name}} كافتراضي", setDefaultFailed: "فشل تعيين التطبيق الافتراضي: {{reason}}", + restoreDefaultFailed: "تعذرت استعادة {{name}} كتطبيق افتراضي، لذا لم يعد هو الافتراضي: {{reason}}", appDeleted: "تم حذف {{name}}", deleteFailed: "فشل حذف التطبيق: {{reason}}", nothingToDelete: "لا يوجد ما يُحذف لـ {{name}}: {{reason}}", diff --git a/ui/packages/i18n/src/locales/de.ts b/ui/packages/i18n/src/locales/de.ts index 5ddd22e678b..cce69008622 100644 --- a/ui/packages/i18n/src/locales/de.ts +++ b/ui/packages/i18n/src/locales/de.ts @@ -5492,6 +5492,7 @@ const de = { toggleFailed: "Ändern des App-Status fehlgeschlagen: {{reason}}", setDefaultDone: "{{name}} als Standard festgelegt", setDefaultFailed: "Festlegen der Standard-App fehlgeschlagen: {{reason}}", + restoreDefaultFailed: "{{name}} konnte nicht als Standard-App wiederhergestellt werden und ist daher nicht mehr der Standard: {{reason}}", appDeleted: "{{name}} gelöscht", deleteFailed: "Löschen der App fehlgeschlagen: {{reason}}", nothingToDelete: "Nichts zu löschen für {{name}}: {{reason}}", diff --git a/ui/packages/i18n/src/locales/en.ts b/ui/packages/i18n/src/locales/en.ts index 0cea44fdcbb..ac4928fc69c 100644 --- a/ui/packages/i18n/src/locales/en.ts +++ b/ui/packages/i18n/src/locales/en.ts @@ -6334,6 +6334,7 @@ const en = { toggleFailed: 'Failed to toggle app status: {{reason}}', setDefaultDone: '{{name}} set as default', setDefaultFailed: 'Failed to set default app: {{reason}}', + restoreDefaultFailed: 'Could not restore {{name}} as the default app, so it is no longer the default: {{reason}}', appDeleted: '{{name}} deleted', deleteFailed: 'Failed to delete app: {{reason}}', // A `reset: false` answer: no customization row existed, so nothing was diff --git a/ui/packages/i18n/src/locales/es.ts b/ui/packages/i18n/src/locales/es.ts index 84568952077..75d20ed34bf 100644 --- a/ui/packages/i18n/src/locales/es.ts +++ b/ui/packages/i18n/src/locales/es.ts @@ -5643,6 +5643,7 @@ const es = { toggleFailed: "Error al cambiar el estado de la aplicación: {{reason}}", setDefaultDone: "{{name}} establecida como predeterminada", setDefaultFailed: "Error al establecer la aplicación predeterminada: {{reason}}", + restoreDefaultFailed: "No se pudo restaurar {{name}} como aplicación predeterminada, por lo que ya no es la predeterminada: {{reason}}", appDeleted: "{{name}} eliminada", deleteFailed: "Error al eliminar la aplicación: {{reason}}", nothingToDelete: "Nada que eliminar para {{name}}: {{reason}}", diff --git a/ui/packages/i18n/src/locales/fr.ts b/ui/packages/i18n/src/locales/fr.ts index a5a90df7709..dfa5240f86a 100644 --- a/ui/packages/i18n/src/locales/fr.ts +++ b/ui/packages/i18n/src/locales/fr.ts @@ -5639,6 +5639,7 @@ const fr = { toggleFailed: "Échec du changement d'état de l'application : {{reason}}", setDefaultDone: "{{name}} définie par défaut", setDefaultFailed: "Échec de la définition de l'application par défaut : {{reason}}", + restoreDefaultFailed: "Impossible de rétablir {{name}} comme application par défaut ; elle n'est donc plus l'application par défaut : {{reason}}", appDeleted: "{{name}} supprimée", deleteFailed: "Échec de la suppression de l'application : {{reason}}", nothingToDelete: "Rien à supprimer pour {{name}} : {{reason}}", diff --git a/ui/packages/i18n/src/locales/ja.ts b/ui/packages/i18n/src/locales/ja.ts index 64f1c26b873..a3434ed56e1 100644 --- a/ui/packages/i18n/src/locales/ja.ts +++ b/ui/packages/i18n/src/locales/ja.ts @@ -5494,6 +5494,7 @@ const ja = { toggleFailed: "アプリの状態の切り替えに失敗しました:{{reason}}", setDefaultDone: "{{name}} をデフォルトに設定しました", setDefaultFailed: "デフォルトアプリの設定に失敗しました:{{reason}}", + restoreDefaultFailed: "{{name}} をデフォルトアプリに戻せなかったため、デフォルトではなくなりました:{{reason}}", appDeleted: "{{name}} を削除しました", deleteFailed: "アプリの削除に失敗しました:{{reason}}", nothingToDelete: "{{name}} に削除するものはありません:{{reason}}", diff --git a/ui/packages/i18n/src/locales/ko.ts b/ui/packages/i18n/src/locales/ko.ts index 11997806b42..59df54f4e47 100644 --- a/ui/packages/i18n/src/locales/ko.ts +++ b/ui/packages/i18n/src/locales/ko.ts @@ -5491,6 +5491,7 @@ const ko = { toggleFailed: "앱 상태 전환 실패: {{reason}}", setDefaultDone: "{{name}}을(를) 기본값으로 설정했습니다", setDefaultFailed: "기본 앱 설정 실패: {{reason}}", + restoreDefaultFailed: "{{name}}을(를) 기본 앱으로 복원하지 못해 더 이상 기본 앱이 아닙니다: {{reason}}", appDeleted: "{{name}}을(를) 삭제했습니다", deleteFailed: "앱 삭제 실패: {{reason}}", nothingToDelete: "{{name}}에 삭제할 항목이 없습니다: {{reason}}", diff --git a/ui/packages/i18n/src/locales/pt-BR.ts b/ui/packages/i18n/src/locales/pt-BR.ts index 4330a0bfc39..ee558ccefcf 100644 --- a/ui/packages/i18n/src/locales/pt-BR.ts +++ b/ui/packages/i18n/src/locales/pt-BR.ts @@ -5638,6 +5638,7 @@ const pt = { toggleFailed: "Falha ao alterar o status do aplicativo: {{reason}}", setDefaultDone: "{{name}} definido como padrão", setDefaultFailed: "Falha ao definir o aplicativo padrão: {{reason}}", + restoreDefaultFailed: "Não foi possível restaurar {{name}} como aplicativo padrão, então ele não é mais o padrão: {{reason}}", appDeleted: "{{name}} excluído", deleteFailed: "Falha ao excluir o aplicativo: {{reason}}", nothingToDelete: "Nada a excluir para {{name}}: {{reason}}", diff --git a/ui/packages/i18n/src/locales/ru.ts b/ui/packages/i18n/src/locales/ru.ts index 49542a91425..1dfd5e4939a 100644 --- a/ui/packages/i18n/src/locales/ru.ts +++ b/ui/packages/i18n/src/locales/ru.ts @@ -5803,6 +5803,7 @@ const ru = { toggleFailed: "Не удалось изменить состояние приложения: {{reason}}", setDefaultDone: "{{name}} установлено по умолчанию", setDefaultFailed: "Не удалось установить приложение по умолчанию: {{reason}}", + restoreDefaultFailed: "Не удалось восстановить {{name}} как приложение по умолчанию, поэтому оно больше не используется по умолчанию: {{reason}}", appDeleted: "{{name}} удалено", deleteFailed: "Не удалось удалить приложение: {{reason}}", nothingToDelete: "Нечего удалять для {{name}}: {{reason}}", diff --git a/ui/packages/i18n/src/locales/zh-Hans.ts b/ui/packages/i18n/src/locales/zh-Hans.ts index ee0a6a38f42..14e43902b09 100644 --- a/ui/packages/i18n/src/locales/zh-Hans.ts +++ b/ui/packages/i18n/src/locales/zh-Hans.ts @@ -5538,6 +5538,7 @@ const zh = { toggleFailed: '切换应用状态失败:{{reason}}', setDefaultDone: '{{name}} 已设为默认', setDefaultFailed: '设置默认应用失败:{{reason}}', + restoreDefaultFailed: '无法将 {{name}} 恢复为默认应用,因此它已不再是默认应用:{{reason}}', appDeleted: '{{name}} 已删除', deleteFailed: '删除应用失败:{{reason}}', nothingToDelete: '{{name}} 无可删除:{{reason}}', diff --git a/ui/packages/i18n/src/locales/zh-Hant.ts b/ui/packages/i18n/src/locales/zh-Hant.ts index 2968c6c99f9..9920e510e03 100644 --- a/ui/packages/i18n/src/locales/zh-Hant.ts +++ b/ui/packages/i18n/src/locales/zh-Hant.ts @@ -5538,6 +5538,7 @@ const zhHant = { toggleFailed: '切換應用狀態失敗:{{reason}}', setDefaultDone: '{{name}} 已設為預設', setDefaultFailed: '設定預設應用失敗:{{reason}}', + restoreDefaultFailed: '無法將 {{name}} 恢復為預設應用,因此它已不再是預設應用:{{reason}}', appDeleted: '{{name}} 已刪除', deleteFailed: '刪除應用失敗:{{reason}}', nothingToDelete: '{{name}} 無可刪除:{{reason}}',