GeezerVison is showing github.com — fix(ws): reconnect after a drop, concurrent queries and per-query abort by Gioee · Pull Request #286 · sqlitecloud/sqlitecloud-js
Conversation
Gioee
commented
Oct 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Builds on #284. Lets a browser keep one websocket connection open instead of opening one per query.
- Reconnect (
websocketReconnect, default true): a drop no longer closes the connection for good. Queries in flight fail with ERR_CONNECTION_ENDED and are not retried (they may have run); later queries wait up to 20 s for socket.io to reconnect. io server disconnect reconnects explicitly. Database accepts commands while reconnecting.
- Concurrent queries (
websocketConcurrent, default false): queries are sent without waiting for the previous one; order is not guaranteed.
- Stateless gateway connection (
websocketStateless, default false): the handshake sends auth.stateless, so the gateway runs each query on its own server connection, in parallel, with no state kept (sqlitecloud/sqlitecloud-gateway#246). Without it the gateway keeps one server connection for the socket and runs its queries in order.
- Abort (
SQLiteCloudCommand.signal): fails the query with the signal's reason before it is sent (any transport) or while it runs (websocket, late response ignored).
Connection string: websocket_reconnect, websocket_concurrent, websocket_stateless.
Tests: unit tests for each case; locally, a gateway killed and restarted under an open Database (in-flight query fails, the one issued while down succeeds after the restart, connection stays open). Integration suites pass apart from the existing 5 s timeouts against staging, same as on #284.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- websocketReconnect (default true): a dropped websocket reconnects instead of closing for good. Queries in flight fail, later ones wait up to 20s for the new connection.
- websocketConcurrent (default false): queries are sent without waiting for the previous one.
- SQLiteCloudCommand.signal aborts a query before it is sent, and while it runs on websocket.
|
❌ Patch coverage is 91.02564% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.15%. Comparing base (1bd46d0) to head (adb9d45).
Additional details and impacted files
@@ Coverage Diff @@
## fix/ws-inflight-query-on-disconnect #286 +/- ##
=======================================================================
+ Coverage 85.71% 86.15% +0.44%
=======================================================================
Files 11 11
Lines 1155 1221 +66
Branches 375 388 +13
=======================================================================
+ Hits 990 1052 +62
- Misses 153 169 +16
+ Partials 12 0 -12
☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
With websocketConcurrent the handshake sends auth.concurrent, so the gateway runs each request on its own connection instead of in order on one kept for the socket.
…ss, not websocketConcurrent
websocketConcurrent only sends queries without waiting. websocketStateless sends auth.stateless, so the gateway runs each query on its own server connection; without it the gateway keeps one for the socket, with its state.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|