ASF-ui
ASF-ui copied to clipboard
Properly handle waiting for ASF restarts
Purpose
Currently the Setup page is responsible for waiting for ASF restart, furthermore, it is currently unable to wait for restart after successful ASF update.
Solution
We should separate restart logic into separate component. This way we do not extend already overly complicated Setup page. Thanks to the separation, we may be able to easily handle update process as well.
The new loading component can be stripped of the layout elements, as with ASF offline we could not load additional assets anyway. Before requesting ASF update, we could preload the component to cache, so it is possible to render even without Kestrel running:
async function preload () {
await import('@/path/to/component.vue')
}
Alternatives
~Archi said no.~ He did not say no.
Additional information
As for the update process, we should do the following:
- Preload restart component
- Send Update request 2.1. If the response arrives within 1,000 ms, proceed as normal - show error
- Else redirect to Update component, let it handle the response
- Inside restart component show loader, wait for response 4.1. If error response arrives, proceed as normal - show error
- Else start waiting for restart
Alternatively we could straight redirect to the restart component and let it handle update fully. This may not be the most user friendly experience (the update request can return "no update available" really quickly), but should be much easier to implement.
ref: https://github.com/JustArchiNET/ArchiSteamFarm/issues/2344