Skip to content

Commit 089fed1

Browse files
committed
Fixed review comments on documentation
1 parent 236e543 commit 089fed1

File tree

5 files changed

+4944
-152
lines changed

5 files changed

+4944
-152
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
Auto-Update of pgAdmin 4 Desktop Application
2+
********************************************
3+
4+
pgAdmin 4's desktop application includes an automated update system built using
5+
Electron's ``autoUpdater`` module. This feature enables users to receive and install
6+
updates seamlessly, ensuring they always have access to the latest features and security fixes.
7+
8+
Supported Platforms
9+
===================
10+
11+
- **macOS:** Fully supported with automatic updates enabled by default
12+
- **Windows:** Not supported
13+
- **Linux:** Not supported
14+
15+
Update Process Overview
16+
=======================
17+
18+
1. **Check for Updates:**
19+
20+
- Automatic check on application startup
21+
- Manual check available via pgAdmin 4 menu > Check for Updates
22+
- Uses Electron's ``autoUpdater`` API to query update server
23+
24+
2. **Download Process:**
25+
26+
- Updates download automatically when detected
27+
- Progress shown via notifications
28+
- Background download prevents interruption of work
29+
30+
3. **Installation Flow:**
31+
32+
- User prompted to Install & Restart or Restart Later when update ready
33+
- Update applied during application restart
34+
35+
The flow chart for the update process is as follows:
36+
37+
.. image:: images/auto_update_desktop_app.png
38+
:alt: Auto-update Desktop App
39+
:align: center
40+
41+
User Interface Components
42+
=========================
43+
44+
1. **Notification Types:**
45+
46+
- Update available
47+
- Download progress
48+
- Update ready to install
49+
- Error notifications
50+
51+
2. **Menu Integration:**
52+
53+
- Check for Updates option in pgAdmin 4 menu
54+
- Restart to Update option when update available
55+
56+
Error Handling
57+
==============
58+
59+
The system includes comprehensive error handling:
60+
61+
1. **Network Errors:**
62+
63+
- Connection timeouts
64+
- Download failures
65+
- Server unavailability
66+
67+
2. **Installation Errors:**
68+
69+
- Corrupted downloads
70+
71+
3. **Recovery Mechanisms:**
72+
73+
- Fallback to manual update
74+
- Error reporting to logs
75+
76+
Security Considerations
77+
=======================
78+
79+
The update system implements below security measures:
80+
81+
1. **Secure Communication:**
82+
83+
- Protected update metadata
84+
85+
Platform-Specific Notes
86+
=======================
87+
88+
1. **macOS:**
89+
90+
- Uses native update mechanisms
91+
- Requires signed packages
92+
93+
References
94+
==========
95+
96+
- `Electron autoUpdater API Documentation <https://www.electronjs.org/docs/latest/api/auto-updater>`_

docs/en_US/desktop_deployment.rst

Lines changed: 4 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -129,155 +129,9 @@ will be available on Unix systems (~/.local/share/pgadmin/),
129129
on Mac OS X (~/Library/Preferences/pgadmin),
130130
and on Windows (%APPDATA%/pgadmin).
131131

132+
For details on the auto-update system for the desktop application, see
132133

133-
Auto-Update of pgAdmin 4 Desktop Application
134-
********************************************
134+
.. toctree::
135+
:maxdepth: 1
135136

136-
pgAdmin 4's desktop application includes an automated update system built using
137-
Electron's ``autoUpdater`` module. This feature enables users to receive and install
138-
updates seamlessly, ensuring they always have access to the latest features and security fixes.
139-
140-
Supported Platforms
141-
===================
142-
143-
- **macOS:** Fully supported with automatic updates enabled by default
144-
- **Windows:** Not supported
145-
- **Linux:** Not supported
146-
147-
Update Process Overview
148-
=======================
149-
150-
1. **Check for Updates:**
151-
152-
- Automatic check on application startup
153-
- Manual check available via pgAdmin 4 menu > Check for Updates
154-
- Uses Electron's ``autoUpdater`` API to query update server
155-
156-
2. **Download Process:**
157-
158-
- Updates download automatically when detected
159-
- Progress shown via notifications
160-
- Background download prevents interruption of work
161-
162-
3. **Installation Flow:**
163-
164-
- User prompted to Install & Restart or Restart Later when update ready
165-
- Update applied during application restart
166-
167-
The flow chart for the update process is as follows:
168-
169-
.. image:: images/auto_update_desktop_app.png
170-
:alt: Runtime View Log
171-
:align: center
172-
173-
Technical Architecture
174-
======================
175-
176-
1. **Main Process**
177-
178-
Handles core update functionality:
179-
180-
File: runtime/src/js/autoUpdaterHandler.js
181-
182-
.. code-block:: javascript
183-
184-
autoUpdater.on('checking-for-update', () => {
185-
misc.writeServerLog('[Auto-Updater]: Checking for update...');
186-
});
187-
188-
autoUpdater.on('update-available', () => {
189-
setConfigAndRefreshMenu('update-available');
190-
misc.writeServerLog('[Auto-Updater]: Update downloading...');
191-
pgAdminMainScreen.webContents.send('notifyAppAutoUpdate', {update_downloading: true});
192-
});
193-
194-
2. **Renderer Process**
195-
196-
Manages user interface updates:
197-
198-
File: web/pgadmin/static/js/BrowserComponent.jsx
199-
200-
.. code-block:: javascript
201-
202-
if (window.electronUI && typeof window.electronUI.notifyAppAutoUpdate === 'function') {
203-
window.electronUI.notifyAppAutoUpdate((data)=>{
204-
if (data?.check_version_update) {
205-
pgAdmin.Browser.check_version_update(true);
206-
} else if (data.update_downloading) {
207-
appAutoUpdateNotifier('Update downloading...', 'info', null, 10000);
208-
} else if (data.no_update_available) {
209-
appAutoUpdateNotifier('No update available...', 'info', null, 10000);
210-
} else if (data.update_downloaded) {
211-
const UPDATE_DOWNLOADED_MESSAGE = gettext('An update is ready. Restart the app now to install it, or later to keep using the current version.');
212-
appAutoUpdateNotifier(UPDATE_DOWNLOADED_MESSAGE, 'warning', installUpdate, null, 'Update downloaded', 'update_downloaded');
213-
} else if (data.error) {
214-
appAutoUpdateNotifier(`${data.errMsg}`, 'error');
215-
} else if (data.update_installed) {
216-
const UPDATE_INSTALLED_MESSAGE = gettext('Update installed successfully!');
217-
appAutoUpdateNotifier(UPDATE_INSTALLED_MESSAGE, 'success');
218-
}
219-
});
220-
}
221-
222-
3. **Update Server Communication**
223-
224-
- Configures update feed URL based on version information
225-
- Handles server response validation
226-
- Manages error conditions
227-
228-
User Interface Components
229-
=========================
230-
231-
1. **Notification Types:**
232-
233-
- Update available
234-
- Download progress
235-
- Update ready to install
236-
- Error notifications
237-
238-
2. **Menu Integration:**
239-
240-
- Check for Updates option in pgAdmin 4 menu
241-
- Restart to Update option when update available
242-
243-
Error Handling
244-
==============
245-
246-
The system includes comprehensive error handling:
247-
248-
1. **Network Errors:**
249-
250-
- Connection timeouts
251-
- Download failures
252-
- Server unavailability
253-
254-
2. **Installation Errors:**
255-
256-
- Corrupted downloads
257-
258-
3. **Recovery Mechanisms:**
259-
260-
- Fallback to manual update
261-
- Error reporting to logs
262-
263-
Security Considerations
264-
=======================
265-
266-
The update system implements below security measures:
267-
268-
1. **Secure Communication:**
269-
270-
- Protected update metadata
271-
272-
Platform-Specific Notes
273-
=======================
274-
275-
1. **macOS:**
276-
277-
- Uses native update mechanisms
278-
- Requires signed packages
279-
280-
References
281-
==========
282-
283-
- `Electron autoUpdater API Documentation <https://www.electronjs.org/docs/latest/api/auto-updater>`_
137+
auto_update_desktop_app

0 commit comments

Comments
 (0)