Skip to content

The agent that grows with you

feat(desktop): route in-place retirement through normal update, discontinued shows notice (round 3 slice 2)

ethernet6539e93b1a9c
diff --git a/apps/desktop/electron/updater/channel-strategy.ts b/apps/desktop/electron/updater/channel-strategy.ts
index c0708984b0a..30a09394521 100644
--- a/apps/desktop/electron/updater/channel-strategy.ts
+++ b/apps/desktop/electron/updater/channel-strategy.ts
@@ -5,7 +5,7 @@ import type { RetirementConsent } from './retirement-state'
import type { UpdaterApplyResultWire, UpdaterStatusWire, UpdaterStrategy } from './index'
export interface ChannelRetirementStatus {
- state: 'available' | 'waiting' | 'incompatible' | 'conflict' | 'migrating' | 'cleanup-pending' | 'complete'
+ state: 'available' | 'waiting' | 'incompatible' | 'conflict' | 'migrating' | 'cleanup-pending' | 'complete' | 'discontinued'
destination: string
version: string
message?: string
@@ -61,19 +61,31 @@ export class ChannelStrategy implements UpdaterStrategy {
}
if (result.kind === 'retirement') {
- const status = this.deps.retirement ? await this.deps.retirement.check(result.retirement) :
- { state: 'waiting' as const, message: 'The retirement receiver is not available in this installation.' }
+ // In-place retirement IS a same-identity update to the pinned stable
+ // build: run it through the native factory (app-installer/electron-updater
+ // available → download → apply), identical to a stable update. Only the
+ // suffixed-identity tier talks to the migration machinery.
+ if (result.retirement.receiverKind === 'in-place') {
+ // Sequence counters are per-channel; a retired preview's sequence says
+ // nothing about the pinned stable build. The native strategy's own
+ // version comparison decides availability, exactly as for stable.
+ return await this.selectNative(base, result.retirement.target, { crossChannel: true })
+ }
- this.selection = { kind: 'retirement', value: result.retirement, state: status.state }
+ // Discontinued (suffixed identity): notice only. No migration callbacks,
+ // no download — the user uninstalls; data stays on disk.
+ this.selection = { kind: 'retirement', value: result.retirement, state: 'discontinued' }
return {
- ...base, retirement: { ...status, destination: result.retirement.target.channel.name, version: result.retirement.target.manifest.request.version }
+ ...base, retirement: { state: 'discontinued', destination: result.retirement.target.channel.name, version: result.retirement.target.manifest.request.version }
}
}
- const target = result.target
+ return await this.selectNative(base, result.target)
+ }
- if (target.manifest.request.sequence <= this.deps.build.sequence) {
+ private async selectNative(base: UpdaterStatusWire, target: ChannelTarget, options: { crossChannel?: boolean } = {}): Promise<UpdaterStatusWire> {
+ if (!options.crossChannel && target.manifest.request.sequence <= this.deps.build.sequence) {
this.selection = { kind: 'empty' }
return { ...base, updateAvailable: false }
diff --git a/apps/desktop/electron/updater/channel.test.ts b/apps/desktop/electron/updater/channel.test.ts
index 1df56bbf13f..f13b8da3416 100644
--- a/apps/desktop/electron/updater/channel.test.ts
+++ b/apps/desktop/electron/updater/channel.test.ts
@@ -84,14 +84,20 @@ async function fixture(): Promise<{
return { build, record, manifest, objects, requests, publish }
}
-async function retiredFixture(): Promise<Awaited<ReturnType<typeof fixture>> & { retired: RetiredChannel }> {
+async function retiredFixture(kind: 'in-place' | 'discontinued' = 'discontinued'): Promise<Awaited<ReturnType<typeof fixture>> & { retired: RetiredChannel }> {
const f = await fixture()
const sourceRecord: ChannelRecord = structuredClone(f.record)
f.record.name = 'stable'
f.record.policy = 'stable-release'
- f.record.identity = { ...f.build.identity, appId: 'chat.nous.hermes', token: 'fedcba0987654321' }
+ if (kind === 'in-place') {
+ // Mainline-like prerelease: the destination IS the stable identity.
+ f.build = { ...f.build, identity: structuredClone(sourceRecord.identity) }
+ f.record.identity = structuredClone(sourceRecord.identity)
+ } else {
+ f.record.identity = { ...f.build.identity, appId: 'chat.nous.hermes', token: 'fedcba0987654321' }
+ }
f.manifest.request = { ...f.manifest.request, channel: 'stable', identity: f.record.identity, version: '1.2.3', windowsVersion: '1.2.3.0', releaseTag: 'v1.2.3' }
f.manifest.packages[0].identity = f.record.identity.appId
f.manifest.packages[0].version = '1.2.3'
@@ -102,7 +108,7 @@ async function retiredFixture(): Promise<Awaited<ReturnType<typeof fixture>> & {
const retired: RetiredChannel = {
...sourceRecord, state: 'retired', destination: 'stable', minimumVersion: '1.0.0',
destinationHead: structuredClone(f.record.head), receiverProtocol: 1,
- receiver: { kind: 'discontinued' }, lastHead: sourceRecord.head
+ receiver: { kind }, lastHead: sourceRecord.head
}
f.objects.set(`/releases/channels/${retired.name}.json`, JSON.stringify(retired))
@@ -215,7 +221,86 @@ test('pins the checked target during apply even after R2 advances, and never aut
expect(f.requests).toHaveLength(2)
})
-test('retirement has a separate consented path and never invokes the ordinary native updater', async (): Promise<void> => {
+test('in-place retirement resolves with the receiver kind and routes through the normal apply path, never the migration machinery', async (): Promise<void> => {
+ const f = await retiredFixture('in-place')
+ let retirementChecks = 0
+ let retirementApplies = 0
+ const nativeCalls: string[] = []
+
+ const resolver = new ChannelResolver({ build: f.build, platform: 'darwin', arch: 'arm64', signer: 'ABCDE12345' })
+ const result = await resolver.resolve()
+ expect(result.kind).toBe('retirement')
+
+ if (result.kind !== 'retirement') { throw new Error('Expected retirement') }
+ expect(result.retirement.receiverKind).toBe('in-place')
+
+ const strategy = new ChannelStrategy({
+ resolver, build: f.build, mechanism: 'electron-updater',
+ nativeFactory: (target) => ({
+ mechanism: 'electron-updater',
+ check: async () => { nativeCalls.push(`check:${target.manifest.request.buildId}`);
+ return { supported: true, updateAvailable: true } },
+ apply: async () => { nativeCalls.push('apply');
+ return { ok: true, handedOff: true } }
+ }),
+ retirement: {
+ check: async () => { retirementChecks += 1;
+ return { state: 'available' } },
+ apply: async () => { retirementApplies += 1;
+ return { ok: true, handedOff: true } }
+ }
+ })
+
+ // Same surface as a stable update: available, no retirement status block.
+ const status = await strategy.check()
+ expect(status.updateAvailable).toBe(true)
+ expect(status.retirement).toBeUndefined()
+ expect(nativeCalls).toEqual([`check:${'c'.repeat(32)}`])
+
+ // Ordinary apply path runs the native strategy, not applyRetirement.
+ expect(await strategy.apply()).toMatchObject({ ok: true, handedOff: true })
+ expect(nativeCalls).toEqual([`check:${'c'.repeat(32)}`, 'apply'])
+ expect(retirementChecks).toBe(0)
+ expect(retirementApplies).toBe(0)
+})
+
+test('discontinued retirement surfaces the notice and never downloads or applies', async (): Promise<void> => {
+ const f = await retiredFixture('discontinued')
+ const migrationCalls: string[] = []
+
+ const resolver = new ChannelResolver({ build: f.build, platform: 'darwin', arch: 'arm64', signer: 'ABCDE12345' })
+ const result = await resolver.resolve()
+ expect(result.kind).toBe('retirement')
+
+ if (result.kind !== 'retirement') { throw new Error('Expected retirement') }
+ expect(result.retirement.receiverKind).toBe('discontinued')
+
+ const strategy = new ChannelStrategy({
+ resolver, build: f.build, mechanism: 'electron-updater',
+ nativeFactory: (): never => { throw new Error('Discontinued retirement must never reach the native updater') },
+ retirement: {
+ check: async () => { migrationCalls.push('check');
+ return { state: 'available' } },
+ apply: async () => { migrationCalls.push('apply');
+ return { ok: true, handedOff: true } }
+ }
+ })
+
+ const status = await strategy.check()
+ expect(status.updateAvailable).toBeUndefined()
+ expect(status.retirement).toMatchObject({ state: 'discontinued', destination: 'stable', version: '1.2.3' })
+ // Neither the migration host nor the native updater was consulted.
+ expect(migrationCalls).toEqual([])
+ // Only channel records and the pinned manifest were read — no artifact fetch.
+ for (const request of f.requests) {
+ expect(request).toMatch(/^\/releases\/(channels\/|channel-builds\/[a-f0-9]+\/build\.json$)/)
+ }
+ expect(f.requests).not.toContain('/releases/channel-builds/cccccccccccccccccccccccccccccccc/darwin/Hermes.zip')
+ // The ordinary apply path refuses rather than downloading.
+ expect(await strategy.apply()).toMatchObject({ ok: false })
+})
+
+test('discontinued retirement never consults the migration callbacks; the consented path is refused', async (): Promise<void> => {
const f = await retiredFixture()
let applied = false
const consents: RetirementConsent[] = []
@@ -225,7 +310,7 @@ test('retirement has a separate consented path and never invokes the ordinary na
build: f.build, mechanism: 'electron-updater',
nativeFactory: (): never => { throw new Error('Not a same-identity update') },
retirement: {
- check: async () => ({ state: 'available' }),
+ check: async () => { throw new Error('Discontinued retirement must not reach the migration host') },
apply: async (_retirement, consent: RetirementConsent) => { consents.push(consent); applied = true;
return { ok: true, handedOff: true } }
@@ -234,14 +319,14 @@ test('retirement has a separate consented path and never invokes the ordinary na
const status = await strategy.check()
expect(status.updateAvailable).toBeUndefined()
- expect(status.retirement).toMatchObject({ state: 'available', destination: 'stable' })
+ expect(status.retirement).toMatchObject({ state: 'discontinued', destination: 'stable' })
expect(applied).toBe(false)
expect(await strategy.apply()).toMatchObject({ ok: false })
expect(applied).toBe(false)
const consent: RetirementConsent = { installStable: true, removePreview: true, workspaceChoice: 'keep-stable' }
- expect(await strategy.applyRetirement(consent)).toMatchObject({ ok: true })
- expect(applied).toBe(true)
- expect(consents).toEqual([consent])
+ expect(await strategy.applyRetirement(consent)).toMatchObject({ ok: false })
+ expect(applied).toBe(false)
+ expect(consents).toEqual([])
})
test.each(['hash', 'identity', 'repository', 'signer', 'escape', 'schema', 'version'] as const)('rejects untrusted %s without falling back', async (fault): Promise<void> => {
diff --git a/apps/desktop/electron/updater/channel.ts b/apps/desktop/electron/updater/channel.ts
index 147bbe7c2a3..3cae36e2e97 100644
--- a/apps/desktop/electron/updater/channel.ts
+++ b/apps/desktop/electron/updater/channel.ts
@@ -3,7 +3,7 @@ import { createHash } from 'node:crypto'
import {
type ActiveChannel, buildPrefix, type ChannelBuild, channelKey, type ChannelManifest,
type ChannelPackage, channelPublicBase, decodeChannelManifest, decodeChannelRecord,
- type RetiredChannel, sameChannelIdentity, validateChannelName
+ type ReceiverKind, type RetiredChannel, sameChannelIdentity, validateChannelName
} from './channel-protocol'
export interface ChannelTarget {
@@ -17,6 +17,8 @@ export interface ChannelTarget {
export interface ChannelRetirement {
source: ChannelBuild
target: ChannelTarget
+ /** Publisher-pinned at retire() time; in-place shares the destination's identity. */
+ receiverKind: ReceiverKind
}
export type ChannelResolution =
| { kind: 'active'; target: ChannelTarget }
@@ -105,7 +107,7 @@ export class ChannelResolver {
const target: ChannelTarget = await this.target({ ...record, head: retired.destinationHead })
if (target.manifest.receiverProtocol !== retired.receiverProtocol) { throw new Error('Stable build has no supported retirement receiver') }
assertVersionFloor(target.manifest.request.sourceVersion, retired.minimumVersion)
- return { kind: 'retirement', retirement: { source: this.deps.build, target } }
+ return { kind: 'retirement', retirement: { source: this.deps.build, target, receiverKind: retired.receiver.kind } }
}
private assertRecord(record: ActiveChannel | RetiredChannel, name: string): void {
diff --git a/apps/desktop/src/app/retirement-view.test.tsx b/apps/desktop/src/app/retirement-view.test.tsx
index 85a2be90db1..0543c3b2027 100644
--- a/apps/desktop/src/app/retirement-view.test.tsx
+++ b/apps/desktop/src/app/retirement-view.test.tsx
@@ -7,7 +7,7 @@ import { I18nProvider } from '@/i18n'
import { en } from '@/i18n/en'
import { $updateStatus, resetUpdateApplyState } from '@/store/updates'
-import { RetirementView } from './retirement-view'
+import { DiscontinuedNotice, RetirementView } from './retirement-view'
afterEach((): void => {
cleanup()
@@ -52,3 +52,41 @@ test.each(['keep-stable', 'open-preview'] as const)(
})
}
)
+
+test('discontinued retirement shows the uninstall notice and persists dismissal per revision', async (): Promise<void> => {
+ const dismissed: string[] = []
+ const stored = new Map<string, string>()
+ const original = { getItem: window.localStorage.getItem.bind(window.localStorage), setItem: window.localStorage.setItem.bind(window.localStorage) }
+ vi.spyOn(window.localStorage, 'getItem').mockImplementation((key: string) => stored.get(key) ?? original.getItem(key))
+ vi.spyOn(window.localStorage, 'setItem').mockImplementation((key: string, value: string) => { stored.set(key, value) })
+
+ const retirement: NonNullable<DesktopUpdateStatus['retirement']> = {
+ state: 'discontinued',
+ destination: 'stable',
+ version: '1.0.0'
+ }
+
+ render(
+ <I18nProvider configClient={null} initialLocale="en">
+ <Dialog open>
+ <DialogContent>
+ <DiscontinuedNotice
+ onDismiss={(): void => { dismissed.push('dismissed') }}
+ retirement={retirement}
+ />
+ </DialogContent>
+ </Dialog>
+ </I18nProvider>
+ )
+
+ // The notice carries the "no longer supported — uninstall" copy, and offers
+ // no download, install, or migration action — only the dismissal.
+ expect(screen.getByText(en.updates.discontinuedTitle)).toBeTruthy()
+ expect(screen.getByText(en.updates.discontinuedBody)).toBeTruthy()
+ expect(screen.queryByRole('button', { name: en.updates.retirementAction })).toBeNull()
+ expect(screen.queryByRole('button', { name: en.updates.updateNow })).toBeNull()
+ expect(screen.queryByRole('checkbox')).toBeNull()
+
+ fireEvent.click(screen.getByRole('button', { name: en.updates.maybeLater }))
+ await waitFor((): void => { expect(dismissed).toEqual(['dismissed']) })
+})
diff --git a/apps/desktop/src/app/retirement-view.tsx b/apps/desktop/src/app/retirement-view.tsx
index 301cd2b8b4f..62670698440 100644
--- a/apps/desktop/src/app/retirement-view.tsx
+++ b/apps/desktop/src/app/retirement-view.tsx
@@ -6,6 +6,33 @@ import type { DesktopRetirementConsent, DesktopUpdateStatus } from '@/global'
import { useI18n } from '@/i18n'
import { applyRetirement } from '@/store/updates'
+/**
+ * The discontinued tier of retirement: a suffixed-identity build (canary /
+ * one-off / debug branch) whose channel has closed. There is nothing to
+ * download or migrate — the user uninstalls. Rendered inside the updates
+ * dialog; dismissal persists per retired-channel revision so it does not nag
+ * on every check.
+ */
+export function DiscontinuedNotice({
+ retirement,
+ onDismiss
+}: {
+ retirement: NonNullable<DesktopUpdateStatus['retirement']>
+ onDismiss: () => void
+}): ReactElement {
+ const { t } = useI18n()
+
+ return (
+ <div className="space-y-4 p-6">
+ <DialogTitle>{t.updates.discontinuedTitle}</DialogTitle>
+ <DialogDescription>{t.updates.discontinuedBody}</DialogDescription>
+ <div className="flex justify-end">
+ <Button onClick={onDismiss} variant="text">{t.updates.maybeLater}</Button>
+ </div>
+ </div>
+ )
+}
+
export function RetirementView({
retirement,
onLater,
diff --git a/apps/desktop/src/app/updates-overlay.tsx b/apps/desktop/src/app/updates-overlay.tsx
index af12546b2b2..69baf503135 100644
--- a/apps/desktop/src/app/updates-overlay.tsx
+++ b/apps/desktop/src/app/updates-overlay.tsx
@@ -17,7 +17,6 @@ import { Loader } from '@/components/ui/loader'
import { Progress } from '@/components/ui/progress'
import { UpdateStatusCard, VersionHero } from '@/components/update-status'
import { VersionDetails } from '@/components/version-details'
-import { RetirementView } from './retirement-view'
import type {
DesktopUpdateCommit,
@@ -45,11 +44,14 @@ import {
applyUpdates,
checkBackendUpdates,
checkUpdates,
+ dismissDiscontinuedNotice,
resetUpdateApplyState,
setUpdateOverlayOpen,
type UpdateApplyState
} from '@/store/updates'
+import { DiscontinuedNotice, RetirementView } from './retirement-view'
+
function totalItems(groups: readonly CommitGroup[]) {
return groups.reduce((sum, g) => sum + g.items.length, 0)
}
@@ -138,8 +140,17 @@ export function UpdatesOverlay() {
<ErrorView message={apply.message} onDismiss={() => handleClose(false)} onRetry={handleInstall} />
) : null}
- {phase === 'idle' && !isBackend && status?.retirement && (
- <RetirementView retirement={status.retirement} onLater={() => handleClose(false)} onRetry={() => void check()} />
+ {phase === 'idle' && !isBackend && status?.retirement?.state === 'discontinued' && (
+ <DiscontinuedNotice
+ onDismiss={() => {
+ dismissDiscontinuedNotice(status.retirement!)
+ handleClose(false)
+ }}
+ retirement={status.retirement}
+ />
+ )}
+ {phase === 'idle' && !isBackend && status?.retirement && status.retirement.state !== 'discontinued' && (
+ <RetirementView onLater={() => handleClose(false)} onRetry={() => void check()} retirement={status.retirement} />
)}
{phase === 'idle' && (isBackend || !status?.retirement) && (
<IdleView
diff --git a/apps/desktop/src/components/update-status.tsx b/apps/desktop/src/components/update-status.tsx
index 5259039d603..5be220b3ecf 100644
--- a/apps/desktop/src/components/update-status.tsx
+++ b/apps/desktop/src/components/update-status.tsx
@@ -43,6 +43,11 @@ function retirementStatus(
supported: boolean,
u: Translations['updates']
): UpdateStatusView {
+ if (retirement.state === 'discontinued') {
+ // Suffixed-identity build: nothing to download or migrate — just the notice.
+ return { applying, supported, updateAvailable: false, tone: 'error', line: u.discontinuedTitle, error: u.discontinuedBody }
+ }
+
const available: boolean = retirement.state === 'available' || retirement.state === 'cleanup-pending'
const line: string = applying ? u.retirementMoving : retirement.state === 'complete' ? u.retirementComplete : u.retirementTitle
@@ -315,7 +320,12 @@ export function UpdateStatusCard({
{checking ? u.checkingShort : u.checkNow}
</Button>
- <UpdateActions retirement={!isBackend && Boolean(status?.retirement)} target={target} u={u} view={view} />
+ <UpdateActions
+ retirement={!isBackend && status?.retirement?.state !== undefined && status.retirement.state !== 'discontinued'}
+ target={target}
+ u={u}
+ view={view}
+ />
{showReleaseNotes && (
<Button asChild className="ml-auto" size="sm" variant="text">
diff --git a/apps/desktop/src/global.d.ts b/apps/desktop/src/global.d.ts
index 6cd6d968d3e..f99be271566 100644
--- a/apps/desktop/src/global.d.ts
+++ b/apps/desktop/src/global.d.ts
@@ -764,7 +764,7 @@ export interface DesktopRetirementConsent {
export interface DesktopUpdateStatus {
supported: boolean
retirement?: {
- state: 'available' | 'waiting' | 'incompatible' | 'conflict' | 'migrating' | 'cleanup-pending' | 'complete'
+ state: 'available' | 'waiting' | 'incompatible' | 'conflict' | 'migrating' | 'cleanup-pending' | 'complete' | 'discontinued'
destination: string
version: string
message?: string
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index bd4643b9bf1..bdb8c8ea4c1 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -3091,6 +3091,8 @@ export const en: Translations = {
retirementBlocked: 'Migration paused — preview preserved',
retirementMoving: 'Moving to stable…',
retirementComplete: 'Stable is ready',
+ discontinuedTitle: 'This build of Hermes is no longer supported',
+ discontinuedBody: 'This build of Hermes is no longer supported and may break — uninstall it. Your data stays on disk.',
channels: { stable: 'Stable', canary: 'Canary' },
bundleSwapPending: 'Restart to finish the update',
bundleSwapPendingDesc: 'The updated app is already installed — Hermes only needs to restart to load it. Chats and settings are untouched.',
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 921b56f5943..21876332e44 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -2666,6 +2666,8 @@ export interface Translations {
retirementBlocked: string
retirementMoving: string
retirementComplete: string
+ discontinuedTitle: string
+ discontinuedBody: string
channels: { stable: string; canary: string }
bundleSwapPending: string
bundleSwapPendingDesc: string
diff --git a/apps/desktop/src/store/updates.test.ts b/apps/desktop/src/store/updates.test.ts
index 611ade64474..47ba6a4b53f 100644
--- a/apps/desktop/src/store/updates.test.ts
+++ b/apps/desktop/src/store/updates.test.ts
@@ -1467,3 +1467,76 @@ describe('startUpdatePoller', () => {
expect(checkMock).toHaveBeenCalledTimes(1)
})
})
+
+describe('discontinued retirement notice', () => {
+ const applyMock = vi.fn()
+ const checkMock = vi.fn()
+
+ const discontinuedStatus = (): DesktopUpdateStatus => ({
+ supported: true,
+ fetchedAt: 0,
+ retirement: { state: 'discontinued', destination: 'stable', version: '1.2.3' }
+ })
+
+ beforeEach(() => {
+ storage.clear()
+ notifySpy.mockClear()
+ dismissSpy.mockClear()
+ applyMock.mockClear()
+ checkMock.mockReset()
+ resetUpdateApplyState()
+ $updateStatus.set(null)
+ $updateOverlayOpen.set(false)
+ checkMock.mockImplementation(async () => discontinuedStatus())
+ ;(globalThis as unknown as { window: unknown }).window = {
+ hermesDesktop: { updates: { apply: applyMock, check: checkMock } }
+ }
+ vi.useRealTimers()
+ })
+
+ afterEach(() => {
+ delete (globalThis as unknown as { window?: unknown }).window
+ })
+
+ it('checkUpdates surfaces the discontinued warning and never offers an apply', async () => {
+ await checkUpdates({ force: true })
+
+ expect(notifySpy).toHaveBeenCalledTimes(1)
+ expect(notifySpy.mock.calls[0]?.[0]).toMatchObject({ kind: 'warning', id: 'desktop-build-discontinued' })
+ // The ordinary update toast must stay silent: nothing can be downloaded.
+ expect(notifySpy.mock.calls[0]?.[0]).not.toMatchObject({ icon: 'gift' })
+
+ // The generic update entry point refuses instead of dispatching an apply.
+ const result = await applyUpdates()
+ expect(result).toMatchObject({ ok: false, error: 'retirement-consent-required' })
+ expect(applyMock).not.toHaveBeenCalled()
+ })
+
+ it('dismissal persists per channel revision: a re-check stays quiet, a new retirement re-notifies', async () => {
+ await checkUpdates({ force: true })
+ ;(notifySpy.mock.calls[0]?.[0] as { onDismiss: () => void }).onDismiss()
+ notifySpy.mockClear()
+
+ // Plain re-check of the same retired revision: no nag.
+ await checkUpdates({ force: true })
+ expect(notifySpy).not.toHaveBeenCalled()
+
+ // The publisher pins a new destination version → the notice returns.
+ checkMock.mockImplementation(async () => ({
+ ...discontinuedStatus(),
+ retirement: { state: 'discontinued', destination: 'stable', version: '1.3.0' }
+ }))
+ await checkUpdates({ force: true })
+ expect(notifySpy).toHaveBeenCalledTimes(1)
+ })
+
+ it('a retirement that is not discontinued never raises the notice', async () => {
+ checkMock.mockImplementation(async () => ({
+ ...discontinuedStatus(),
+ retirement: { state: 'available', destination: 'stable', version: '1.2.3' }
+ }))
+ await checkUpdates({ force: true })
+
+ expect(notifySpy.mock.calls.filter(call => call[0]?.id === 'desktop-build-discontinued')).toHaveLength(0)
+ })
+})
diff --git a/apps/desktop/src/store/updates.ts b/apps/desktop/src/store/updates.ts
index a86b0933bd0..6cc24bb680a 100644
--- a/apps/desktop/src/store/updates.ts
+++ b/apps/desktop/src/store/updates.ts
@@ -26,6 +26,11 @@ import { dismissNotification, notify } from '@/store/notifications'
import { $connection } from '@/store/session'
import type { BackendUpdateCheckResponse } from '@/types/hermes'
+/** Keyed per retired-channel revision: a new retirement (or a revision bump on
+ * the same channel) re-shows the notice, a plain re-check never does. */
+const DISCONTINUED_DISMISS_KEY = 'hermes:discontinued-notice-dismissed-for'
+const DISCONTINUED_TOAST_ID = 'desktop-build-discontinued'
+
export interface UpdateApplyState {
applying: boolean
stage: DesktopUpdateStage
@@ -264,6 +269,41 @@ export function maybeNotifyUpdateAvailable(status: DesktopUpdateStatus | null, t
})
}
+/** Which retired-channel revision the discontinued notice was dismissed for. */
+function discontinuedDismissKey(retirement: NonNullable<DesktopUpdateStatus['retirement']>): string {
+ return `${retirement.destination}@${retirement.version}`
+}
+
+/** Persist the dismissal so plain re-checks never nag; a new retirement re-shows. */
+export function dismissDiscontinuedNotice(retirement: NonNullable<DesktopUpdateStatus['retirement']>): void {
+ persistString(DISCONTINUED_DISMISS_KEY, discontinuedDismissKey(retirement))
+ dismissNotification(DISCONTINUED_TOAST_ID)
+}
+
+/**
+ * The discontinued retirement tier surfaces as a warning toast on check — no
+ * download is ever offered. Suppressed once dismissed for this channel
+ * revision; a fresh retirement re-notifies.
+ */
+function maybeNotifyDiscontinued(retirement: NonNullable<DesktopUpdateStatus['retirement']>): void {
+ if (retirement.state !== 'discontinued') { return }
+ if (storedString(DISCONTINUED_DISMISS_KEY) === discontinuedDismissKey(retirement)) { return }
+
+ notify({
+ action: {
+ label: translateNow('notifications.seeWhatsNew'),
+ onClick: () => openUpdateOverlayFor('client')
+ },
+ durationMs: 0,
+ icon: 'warning',
+ id: DISCONTINUED_TOAST_ID,
+ kind: 'warning',
+ message: translateNow('updates.discontinuedBody'),
+ onDismiss: () => dismissDiscontinuedNotice(retirement),
+ title: translateNow('updates.discontinuedTitle')
+ })
+}
+
/** The target a generic, surface-less update command acts on: the machine the
* user is connected to. Surfaces that display one target's status must pass
* that target explicitly instead of inheriting this. */
@@ -445,6 +485,7 @@ export async function checkUpdates({ force = false }: UpdateCheckOptions = {}):
try {
const status = await bridge.check({ force })
$updateStatus.set(status)
+ if (status.retirement) { maybeNotifyDiscontinued(status.retirement) }
maybeNotifyUpdateAvailable(status, 'client')
void refreshDesktopVersion()