Skip to content
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

feat: Auto Update Toggle Switch #461

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

derfelix54
Copy link

Summary of Changes

  • Adds an Auto Update Toggle to the Download Settings.
  • Aircraft should update automatically when toggled on and an Update is available.

Screenshots (if necessary)

AutoUpdate

Additional context

First React Feature I am doing so I would appreciate your feedback.

Discord username (if different from GitHub):
verolix22

verolix added 3 commits March 23, 2024 18:39
# Conflicts:
#	src/common/settings.ts
#	src/renderer/components/AddonSection/index.tsx
#	src/renderer/components/SettingsSection/Download.tsx
@derfelix54 derfelix54 changed the title Auto Update Toogle Switch feat: Auto Update Toogle Switch Mar 29, 2024
@tracernz
Copy link
Member

What happens if MSFS is running?

@derfelix54
Copy link
Author

Good Point! @tracernz I didn't test this. The same if you press update while msfs is running I guess. I use the handleInstall() function. But I should add another check because I assume that it will call this the whole time if auto update is turned on while msfs is running.

@tracernz
Copy link
Member

Yeah, it would be super nice to defer the update until the sim is shut down if it’s running. Not sure how difficult that would be code-wise.

@derfelix54 derfelix54 changed the title feat: Auto Update Toogle Switch feat: Auto Update Toggle Switch Mar 30, 2024
@FoxtrotSierra6829
Copy link
Member

As an electron app, the installer is not designed to be left open all the time, which this setting would encourage doing. Unless we build a lightweight helper service for this purpose, I don't think it is the best idea to implement such function. Furthermore, even if we have detection if MSFS is running so to not break the installation, this could still cause other services or games to suddenly have insufficient bandwidth without prior user input or warning. To solve this, we would require resource monitoring so we can throttle the download if required.

@derfelix54
Copy link
Author

What happens if MSFS is running?

First about this. I tested it with the master to see if there was a prevention to update while msfs is running and there is not. At least not in master. I am not sure but I thought the installer had something like that with a corresponding error message. Am I wrong?

@derfelix54
Copy link
Author

As an electron app, the installer is not designed to be left open all the time, which this setting would encourage doing. Unless we build a lightweight helper service for this purpose, I don't think it is the best idea to implement such function. Furthermore, even if we have detection if MSFS is running so to not break the installation, this could still cause other services or games to suddenly have insufficient bandwidth without prior user input or warning. To solve this, we would require resource monitoring so we can throttle the download if required.

Not sure what your point is. This feature is only a convenience function. It should do the same if you press the "Update" button. So if you open the installer it does it automatically. If it is already open then, if switched on, it also updates automatically. The same as pressing the button. So it doesn't do anything new in that sense. I don't think it will encourage the users to leave it open more often. If you don't want that then there needs some other prevention for this. Of course, if the team decides otherwise, I can close this pull request. I just thought it would be a great feature.

@2hwk
Copy link
Member

2hwk commented Apr 1, 2024

This would lead as well to more usage of our CDN, while it is a good convenient factor for users, we'd also have to consider the impact on our network infrastructure and bandwidth costs.

@FoxtrotSierra6829
Copy link
Member

What happens if MSFS is running?

First about this. I tested it with the master to see if there was a prevention to update while msfs is running and there is not. At least not in master. I am not sure but I thought the installer had something like that with a corresponding error message. Am I wrong?

#463 was looking into when it's triggered, and figured it's currently inoperative

@FoxtrotSierra6829
Copy link
Member

As an electron app, the installer is not designed to be left open all the time, which this setting would encourage doing. Unless we build a lightweight helper service for this purpose, I don't think it is the best idea to implement such function. Furthermore, even if we have detection if MSFS is running so to not break the installation, this could still cause other services or games to suddenly have insufficient bandwidth without prior user input or warning. To solve this, we would require resource monitoring so we can throttle the download if required.

Not sure what your point is. This feature is only a convenience function. It should do the same if you press the "Update" button. So if you open the installer it does it automatically. If it is already open then, if switched on, it also updates automatically. The same as pressing the button. So it doesn't do anything new in that sense. I don't think it will encourage the users to leave it open more often. If you don't want that then there needs some other prevention for this. Of course, if the team decides otherwise, I can close this pull request. I just thought it would be a great feature.

Don't get me wrong, it's not a bad idea. I just think it needs a more sophisticated solution if we want to implement it.

@derfelix54
Copy link
Author

@FoxtrotSierra6829 so you would suggest to build a standalone "update.exe" to do this which is called from the installer? Or am I misunderstanding you here?

@FoxtrotSierra6829
Copy link
Member

This could be achieved with two different approaches, one would be to have a helper service check if an addon needs to be updated and then launch the main application (minimized) with a parameter to update the addon, then close the main application again. The other would be to fully transfer all installation and update functions to a helper service and call that service for all these operations from the GUI. That in turn would need some protocol to exchange status information.

At least that's my opinion on this, maybe others here have a different one.

@FoxtrotSierra6829
Copy link
Member

Also, the PR in its current stage only supports auto-updating of the currently selected addon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants