Skip to content

Add subprotocol check to the client#333

Merged
ai merged 6 commits intohplush:mainfrom
ilyatitovich:core/check-subprotocol
Feb 7, 2026
Merged

Add subprotocol check to the client#333
ai merged 6 commits intohplush:mainfrom
ilyatitovich:core/check-subprotocol

Conversation

@ilyatitovich
Copy link
Copy Markdown
Contributor

Fixes #245

  • Added isClientUpdateRequired atom store to trigger Update Client page when the client uses an unsupported subprotocol (below server minSubprotocol);
  • Added handling of unsupported subprotocols for both HTTP requests and Logux WebSocket errors;
  • Added router logic to redirect users to /update-client when a client update is required;
  • Added a simple Update Client page with temp test data;
  • Added tests.

Motivation

This change introduces a unified mechanism for detecting unsupported client versions across HTTP and Logux, and redirects users to an update page.

Comment thread server/lib/http.ts Outdated
Comment thread core/lib/http.ts Outdated
Comment thread web/stories/pages/update-client.stories.svelte Outdated
Comment thread core/router.ts Outdated
Comment thread web/pages/update-client.svelte Outdated
@ai
Copy link
Copy Markdown
Contributor

ai commented Jan 28, 2026

Pretty solid PR (expect page design, to be honest). All changes are coming from things missed in the task. Good work 👍

@ilyatitovich
Copy link
Copy Markdown
Contributor Author

  • Removed custom headers. Now outdated client detection uses response body;
  • Redesign Update Client page.
Screenshot from 2026-01-29 12-24-25

I'm a bit confused about router. Now with:

if (outdatedClient) {
   nextRoute = redirect(open('updateClient'))
}

we redirect user to Update Client page. Should we keep this behavior or just use nextRoute = open('updateClient')?

In main.svelte we pass $currentPage into component, so I assume that udpateClient must be set in core router.

Comment thread core/client.ts Outdated
Comment thread web/main/main.svelte Outdated
Comment thread core/pages/update-client.ts Outdated
@ilyatitovich
Copy link
Copy Markdown
Contributor Author

  • Removed handleOutdatedClient helper;
  • Removed isOutdatedClient from the core router: the Update Client page is now handled by the web router.

@ai ai merged commit f7b39e1 into hplush:main Feb 7, 2026
10 checks passed
@ai
Copy link
Copy Markdown
Contributor

ai commented Feb 7, 2026

Thanks!

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.

Add subprotocol check to the client

2 participants