-
-
Notifications
You must be signed in to change notification settings - Fork 193
Add AutoUpdater feature with events and facade support #570
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
Introduces the `AutoUpdater` class to manage update processes via the client. Adds events such as `UpdateAvailable`, `UpdateDownloaded`, and others for broadcasting update states. A facade is also provided for convenient usage.
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! Did you try it on your app?
Hey! Great addition 👍 what are your thoughts on adding a UpdateProgress event (or something like that) to a enable download progress indicator? |
This event handles broadcasting download progress updates through a 'nativephp' channel. It includes details such as total size, delta, transferred bytes, percentage completed, and speed.
@SRWieZ yes I have tested this in my app. Here is a log excerpt: \Native\Laravel\Events\AutoUpdater\UpdateAvailable \Native\Laravel\Events\AutoUpdater\DownloadProgress {"total":121891223,"delta":60969106,"transferred":60969106,"percent":50.01927497273532,"bytesPerSecond":60969106} \Native\Laravel\Events\AutoUpdater\UpdateDownloaded {"version":"1.0.2","downloadedFile":"/Users/WINBIGFOX/Library/Caches/timescribe-updater/pending/TimeScribe-1.0.2-arm64.zip","releaseDate":"2025-04-25T19:38:08.061Z","releaseNotes":" <span class="issue-keyword tooltipped tooltipped-se">Fixed <a class="issue-link js-issue-link" href="https://github.com/WINBIGFOX/TimeScribe/issues/7\">#7 Add optimize command and update filesystem config Added an `optimize` Artisan command that immediately exits. Updated the filesystem configuration to simplify the public driver and removed default storage symlink settings. These changes aim to improve maintainability and streamline application behavior. ","releaseName":"v1.0.2"}@gwleuverink I have added the DownloadProgress event |
@SRWieZ Do you already know when you're planning a new release? |
I don't know unfortunately. The team is also busy releasing v1 of NativePHP for mobile this week. |
This is great! Are you up to write up something in the docs for this? I also have some thoughts for discussion, doesn't have to block this PR. Right now updates are downloaded automatically. Now we have a better api to handle this it might be worth adding a way to disable auto updates. I'm thinking by config and/or persisting the setting through a method on the AutoUpdater facade we can call in the service provider. Thoughts? @SRWieZ @WINBIGFOX |
Or even disable auto updates altogether and let people handle it on boot themselves |
@gwleuverink I can also write the documentation. I don't think your suggestion to switch off the auto updates is a bad one. Especially if the user has deactivated the push notifications, he will not receive any information about an available update. I have also noticed in the app that users rarely restart their Mac or close the program. As a result, available updates are only rolled out very slowly. In future, I will control the updates in my app myself so that this happens more reliably. |
I kinda forgot about docs but @WINBIGFOX if you can write a PR for all the recent changes would be great. A single PR is fine. @gwleuverink absolutely! As someone that disable auto update because I'm working a lot on 4G/5G network, I would absolutely love that. |
Adjusted the types of total, delta, and bytesPerSecond from float to int to ensure type consistency and accuracy. This change prevents potential precision issues and aligns with expected data formats.
@gwleuverink @SRWieZ Here is the PR for the docs |
Introduces the
AutoUpdater
class to manage update processes via the client. Adds events such asUpdateAvailable
,UpdateDownloaded
, and others for broadcasting update states. A facade is also provided for convenient usage.PR:
NativePHP/electron: NativePHP/electron#213