JustArchiNET / ASF-ui

The official web interface for ASF
Apache License 2.0
259 stars 37 forks source link

Properly handle waiting for ASF restarts #1451

Open Aareksio opened 3 years ago

Aareksio commented 3 years ago

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:

  1. Preload restart component
  2. Send Update request 2.1. If the response arrives within 1,000 ms, proceed as normal - show error
  3. Else redirect to Update component, let it handle the response
  4. Inside restart component show loader, wait for response 4.1. If error response arrives, proceed as normal - show error
  5. 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.

JustArchi commented 3 years ago

ref: https://github.com/JustArchiNET/ArchiSteamFarm/issues/2344