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

Add subprotocol check to the client #245

Open
ai opened this issue Sep 11, 2024 · 0 comments
Open

Add subprotocol check to the client #245

ai opened this issue Sep 11, 2024 · 0 comments
Labels

Comments

@ai
Copy link
Contributor

ai commented Sep 11, 2024

User may use old client. We need to handle this case and instead of server error (because of old protocol) show the proper message to update client.

To do it we use “Subprotocol”, client-server API version. We use it in Logux. Logux clients send their version in all actions. Logux Server has a range of supported versions.

We need to add the same logic to HTTP API:

  1. Add X-Subprotocol header to fetchJSON() helper
  2. See Logux Server code to find our how to check supported range.
  3. Add this check to jsonApi() and respond a proper error message on it.
  4. Add a Update client route to the core/ router. You may need boolean store and add logic to compute in the router.
  5. Add a Update client to the web client with simple design. See How create a page.
  6. Add code to the core to set that boolean store to true in case of Logux error or fetchJSON error, which ask to update the client.
@ai ai added the Core JS label Sep 11, 2024
@github-project-automation github-project-automation bot moved this to Ready to Take in Slow Reader Tasks Sep 11, 2024
@ai ai moved this from Ready to Take to Onboarding in Slow Reader Tasks Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready to Take
Development

No branches or pull requests

1 participant