You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: After enabling delta updates for macOS in electron-updater, we observed that once the app downloads the zip file in the background, it becomes unresponsive for a period, and the mouse shows a loading icon. Additionally, our Sentry has captured main process ANR (Application Not Responding) events reported by the app.
Analysis: Upon reviewing the code, I found that in order to implement delta updates, the MacUpdater calls the synchronous copyFileSync Node API to cache the file after the zip file is downloaded locally. This synchronous API blocks the Electron main process, especially when the zip file is large, causing the app to freeze for longer periods (our zip file is around 400MB).
Issue: After enabling delta updates for macOS in electron-updater, we observed that once the app downloads the zip file in the background, it becomes unresponsive for a period, and the mouse shows a loading icon. Additionally, our Sentry has captured main process ANR (Application Not Responding) events reported by the app.
Analysis: Upon reviewing the code, I found that in order to implement delta updates, the MacUpdater calls the synchronous copyFileSync Node API to cache the file after the zip file is downloaded locally. This synchronous API blocks the Electron main process, especially when the zip file is large, causing the app to freeze for longer periods (our zip file is around 400MB).
electron-builder/packages/electron-updater/src/MacUpdater.ts
Lines 120 to 129 in 74d98d8
Solution: Replace copyFileSync with an asynchronous API, such as the copyFile method provided by the fs-extra module for file copying.
The text was updated successfully, but these errors were encountered: