Skip to content

The agent that grows with you

fix(desktop): count a native macOS release tag as update identity for background notifications

ethernet0408962c80be
diff --git a/apps/desktop/src/store/updates.test.ts b/apps/desktop/src/store/updates.test.ts
index d7cf820f3ee..19002162a50 100644
--- a/apps/desktop/src/store/updates.test.ts
+++ b/apps/desktop/src/store/updates.test.ts
@@ -274,6 +274,24 @@ describe('maybeNotifyUpdateAvailable', () => {
expect(notifySpy.mock.calls[0]?.[0]).toMatchObject({ message: en.notifications.updateReadyMessageAppInstaller })
})
+ // A native macOS (electron-updater) check has no commit to name either: its
+ // target identity is the release tag. Requiring targetSha silenced every
+ // background notification for non-channel macOS builds.
+ it('notifies for a native macOS check that names its target by release tag', () => {
+ maybeNotifyUpdateAvailable(
+ status({
+ behind: null,
+ currentVersion: '0.19.0',
+ latestTag: 'v0.20.0',
+ mechanism: 'electron-updater',
+ targetSha: undefined,
+ updateAvailable: true
+ })
+ )
+
+ expect(notifySpy).toHaveBeenCalledTimes(1)
+ })
+
// Eligibility stays mechanism-specific: a git-style check must still prove
// there is a target commit before the toast fires — never a made-up SHA.
it('stays quiet for a git-style check that names no target commit', () => {
diff --git a/apps/desktop/src/store/updates.ts b/apps/desktop/src/store/updates.ts
index b94eebc3a8c..af973360984 100644
--- a/apps/desktop/src/store/updates.ts
+++ b/apps/desktop/src/store/updates.ts
@@ -226,9 +226,13 @@ export function maybeNotifyUpdateAvailable(status: DesktopUpdateStatus | null, t
}
// The package update owner reports availability without a commit SHA.
- // Git checks must still identify their target commit.
- const hasTargetIdentity =
- Boolean(status.targetSha) || status.mechanism === 'app-installer' || status.mechanism === 'microsoft-store'
+ // Git checks must still identify their target commit; a native macOS
+ // (electron-updater) check names its target by release tag instead.
+ const hasTargetIdentity: boolean =
+ Boolean(status.targetSha) ||
+ Boolean(status.latestTag) ||
+ status.mechanism === 'app-installer' ||
+ status.mechanism === 'microsoft-store'
if (!hasTargetIdentity) {
return