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

Feature/move server frontend mapping to the frontend #591

Conversation

schroda
Copy link
Collaborator

@schroda schroda commented Jul 1, 2023

Currently the webUI requires a server release.
This PR enables the webUI to do its own releases by adding the functionality to the server to download the latest webUI version.
The webUI defines which webUI version is compatible with which server version.
Thus, the server can download the latest compatible version based on its version.

The mapping of webUI version to server version is a file inside the webUI repo.
This file gets updated each time a new webUI version gets released which requires a newer server version than the previous release.

example:

  • ui: PREVIEW; server: x
  • ui: v5; server: v3
  • ui: v2; server: v2

In this example

  • the current preview version requires a newer server version than v3.
  • each webUI version from ("[": =>; "]": <=; "(": >; ")": <)
    • [v5, PREVIEW) is compatible with server versions [v3, x)
    • [v2, v5) is compatible with server versions [v2, v3)

This does not change the current behaviour of the server release bundling a webUI version.
This version is still used as a fallback in case everything else fails.

How the server will setup the webUI:

  • local webUI is available?
    • available: local version is valid?
      • valid: check for update
        • update available?
          • available: download latest version if auto update is enabled
          • up-to-date: -
      • invalid: download latest version
        • download result handling
    • missing: download latest version
      • download result handling

download result handling:

  • download failed?
    • yes: is default webUI
      • yes: fallback to bundled version
      • no: fallback to default webUI and retry download latest version

Support for different webUIs is also added.
As long as they fullfill the required conditions, e.g. version mapping file in correct format, available version downloads, they can be defined in the server to be provided as an optional webUI that can be used.
In case the server runs into issues with one of these webUIs (e.g. download not possible) it will fallback to the default webUI

@schroda schroda force-pushed the feature/move_server_frontend_mapping_to_the_frontend branch 3 times, most recently from 9ac3f68 to 382adf7 Compare July 1, 2023 23:45
@schroda schroda marked this pull request as ready for review July 1, 2023 23:45
@schroda schroda marked this pull request as draft July 4, 2023 13:07
@schroda schroda force-pushed the feature/move_server_frontend_mapping_to_the_frontend branch from 382adf7 to cac6b75 Compare July 4, 2023 19:15
@schroda schroda marked this pull request as ready for review July 4, 2023 19:17
@schroda schroda force-pushed the feature/move_server_frontend_mapping_to_the_frontend branch 5 times, most recently from 14bd291 to 17c2a15 Compare July 13, 2023 12:16
Copy link
Collaborator

@Syer10 Syer10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schroda Is this ready to be merged? WebUI has the mapping?

@schroda schroda force-pushed the feature/move_server_frontend_mapping_to_the_frontend branch from c258adf to 96bc901 Compare July 20, 2023 22:13
@schroda
Copy link
Collaborator Author

schroda commented Jul 20, 2023

@schroda Is this ready to be merged? WebUI has the mapping?

not yet, I'll ping you when it's ready


I updated the automated webUI update check to use the "HAScheduler"

@schroda schroda force-pushed the feature/move_server_frontend_mapping_to_the_frontend branch from 96bc901 to 891cd73 Compare July 21, 2023 00:36
@schroda schroda force-pushed the feature/move_server_frontend_mapping_to_the_frontend branch from 891cd73 to 531705d Compare July 21, 2023 00:38
@schroda
Copy link
Collaborator Author

schroda commented Jul 21, 2023

I added a function to get the latest version of the webUI preview, instead of having to change the naming pattern of the bundled webUI zip file from Tachidesk-WebUI-<revision>.zip to Tachidesk-WebUI.zip

@schroda
Copy link
Collaborator Author

schroda commented Jul 21, 2023

webUI repo is up-to-date

@Syer10 Syer10 merged commit e920615 into Suwayomi:master Jul 21, 2023
@schroda schroda deleted the feature/move_server_frontend_mapping_to_the_frontend branch July 21, 2023 17:23
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.

2 participants