-
-
Notifications
You must be signed in to change notification settings - Fork 84
Add auto-updater API to Electron server #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Integrates new auto-updater routes for checking updates and installing them. Also includes event listeners to notify Laravel about update states like availability, download completion, and errors. This enhances the app's ability to manage updates seamlessly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but plugin:test
seems to be failing. Can you look into it?
Oh, okay, I'll check that again. |
This commit introduces a new "download-progress" event listener in the autoUpdater module. It forwards progress details, such as percentage and speed, to Laravel via the notifyLaravel function. Additionally, the electron-updater module is now mocked in tests for better coverage.
@SRWieZ I fixed the test and added the DownloadProgress event |
@@ -0,0 +1,61 @@ | |||
import express from "express"; | |||
import electronUpdater from "electron-updater"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Importing the autoUpdater directly might decrease bundle size (untested)
const router = express.Router(); | ||
const { autoUpdater } = electronUpdater; | ||
router.post("/check-for-updates", (req, res) => { | ||
autoUpdater.checkForUpdates(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea: If you add a guard clause here you might be able to prevent the download from happening multiple times.
Set a Boolean & make sure to reset it when the download finishes/fails
Integrates new auto-updater routes for checking updates and installing them. Also includes event listeners to notify Laravel about update states like availability, download completion, and errors. This enhances the app's ability to manage updates seamlessly.
PR:
NativePHP/laravel: NativePHP/laravel#570