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
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"bun-types": "^1.3.1",
"code-inspector-plugin": "^1.2.2",
"cross-env": "^10.0.0",
"electron": "40.0.0",
"electron": "40.2.1",
"electron-builder": "^26.4.0",
"electron-extension-installer": "^2.0.0",
"electron-vite": "^4.0.0",
Expand Down
26 changes: 19 additions & 7 deletions apps/desktop/src/main/lib/auto-updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ export function setupAutoUpdater(): void {

autoUpdater.autoDownload = true;
autoUpdater.autoInstallOnAppQuit = true;
autoUpdater.disableDifferentialDownload = true;

// Allow downgrade for prerelease builds so users can switch back to stable
autoUpdater.allowDowngrade = IS_PRERELEASE;
Expand All @@ -215,42 +216,53 @@ export function setupAutoUpdater(): void {
url: UPDATE_FEED_URL,
});

console.info(
`[auto-updater] Initialized: version=${app.getVersion()}, channel=${IS_PRERELEASE ? "canary" : "stable"}, feedURL=${UPDATE_FEED_URL}`,
);

autoUpdater.on("error", (error) => {
if (isNetworkError(error)) {
console.info("[auto-updater] Network unavailable, will retry later");
emitStatus(AUTO_UPDATE_STATUS.IDLE);
return;
}
console.error("[auto-updater] Error during update check:", error);
console.error(
`[auto-updater] Error during update (currentVersion=${app.getVersion()}):`,
error?.message || error,
);
emitStatus(AUTO_UPDATE_STATUS.ERROR, undefined, error.message);
});

autoUpdater.on("checking-for-update", () => {
console.info("[auto-updater] Checking for updates...");
console.info(
`[auto-updater] Checking for updates... (currentVersion=${app.getVersion()}, feedURL=${UPDATE_FEED_URL})`,
);
emitStatus(AUTO_UPDATE_STATUS.CHECKING);
});

autoUpdater.on("update-available", (info) => {
console.info(
`[auto-updater] Update available: ${info.version}. Downloading...`,
`[auto-updater] Update available: ${app.getVersion()} → ${info.version} (files: ${info.files?.map((f: { url: string }) => f.url).join(", ")})`,
);
emitStatus(AUTO_UPDATE_STATUS.DOWNLOADING, info.version);
});

autoUpdater.on("update-not-available", () => {
console.info("[auto-updater] No updates available");
autoUpdater.on("update-not-available", (info) => {
console.info(
`[auto-updater] No updates available (currentVersion=${app.getVersion()}, latestVersion=${info.version})`,
);
emitStatus(AUTO_UPDATE_STATUS.IDLE);
});

autoUpdater.on("download-progress", (progress) => {
console.info(
`[auto-updater] Download progress: ${progress.percent.toFixed(1)}%`,
`[auto-updater] Download progress: ${progress.percent.toFixed(1)}% (${(progress.transferred / 1024 / 1024).toFixed(1)}MB / ${(progress.total / 1024 / 1024).toFixed(1)}MB)`,
);
});

autoUpdater.on("update-downloaded", (info) => {
console.info(
`[auto-updater] Update downloaded (${info.version}). Ready to install.`,
`[auto-updater] Update downloaded: ${app.getVersion()} → ${info.version}. Ready to install.`,
);
emitStatus(AUTO_UPDATE_STATUS.READY, info.version);
});
Expand Down
8 changes: 4 additions & 4 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.