Fixed following issues related to auto-update:

1. Fixed the issue where auto-update was not working for macOS x64 arch machines as pgadmin4 zip file name has x86_64 in it.
2. Improved error handling in the /upgrade_check API by replacing the static “Failed to check for update” message for Windows users with a dynamic error message.
3. Fixed the CSS issue affecting the close icon in the warning notifier.
4. Removed trailing periods from helper texts and notifier messages in the app’s auto-update workflow. #9133
This commit is contained in:
Anil Sahoo
2025-10-13 17:25:14 +05:30
committed by GitHub
parent 758bbc7272
commit 5f22b4e2d2
9 changed files with 32 additions and 29 deletions
+5 -5
View File
@@ -21,24 +21,24 @@ export function updateConfigAndMenus(event, configStore, pgAdminMainScreen, menu
// This function registers autoUpdater event listeners ONCE
function registerAutoUpdaterEvents({ pgAdminMainScreen, configStore, menuCallbacks }) {
autoUpdater.on('checking-for-update', () => {
misc.writeServerLog('[Auto-Updater]: Checking for update...');
misc.writeServerLog('[Auto-Updater]: Checking for update.');
});
autoUpdater.on('update-available', () => {
updateConfigAndMenus('update-available', configStore, pgAdminMainScreen, menuCallbacks);
misc.writeServerLog('[Auto-Updater]: Update downloading...');
misc.writeServerLog('[Auto-Updater]: Update downloading.');
pgAdminMainScreen.webContents.send('notifyAppAutoUpdate', { update_downloading: true });
});
autoUpdater.on('update-not-available', () => {
updateConfigAndMenus('update-not-available', configStore, pgAdminMainScreen, menuCallbacks);
misc.writeServerLog('[Auto-Updater]: No update available...');
misc.writeServerLog('[Auto-Updater]: No update available.');
pgAdminMainScreen.webContents.send('notifyAppAutoUpdate', { no_update_available: true });
});
autoUpdater.on('update-downloaded', () => {
updateConfigAndMenus('update-downloaded', configStore, pgAdminMainScreen, menuCallbacks);
misc.writeServerLog('[Auto-Updater]: Update downloaded...');
misc.writeServerLog('[Auto-Updater]: Update downloaded.');
pgAdminMainScreen.webContents.send('notifyAppAutoUpdate', { update_downloaded: true });
});
@@ -82,7 +82,7 @@ function handleSendDataForAppUpdate({
try {
autoUpdater.setFeedURL({ url: serverUrl });
misc.writeServerLog('[Auto-Updater]: Initiating update check...');
misc.writeServerLog('[Auto-Updater]: Initiating update check.');
autoUpdater.checkForUpdates();
} catch (err) {
misc.writeServerLog('[Auto-Updater]: Error setting autoUpdater feed URL: ' + err.message);
+1 -1
View File
@@ -75,7 +75,7 @@ function handleAutoUpdateMenu(menuFile, configStore, callbacks) {
menuFile.submenu.unshift({
name: 'mnu_restart_to_update',
id: 'mnu_restart_to_update',
label: 'Restart to Update...',
label: 'Restart to Update',
enabled: true,
priority: 998,
click: callbacks['restart_to_update'],
+2 -2
View File
@@ -443,14 +443,14 @@ function notifyUpdateInstalled() {
try {
// Notify renderer
if (pgAdminMainScreen) {
misc.writeServerLog('[Auto-Updater]: Update installed successfully...');
misc.writeServerLog('[Auto-Updater]: Update installed successfully.');
setTimeout(() => {
pgAdminMainScreen.webContents.send('notifyAppAutoUpdate', {update_installed: true});
}, 10000);
} else {
// If main screen not ready, wait and send after it's created
app.once('browser-window-created', (event, window) => {
misc.writeServerLog('[Auto-Updater]: Update installed successfully...');
misc.writeServerLog('[Auto-Updater]: Update installed successfully.');
setTimeout(() => {
pgAdminMainScreen.webContents.send('notifyAppAutoUpdate', {update_installed: true});
}, 10000);