GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@Gioee Gioee commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions
@Gioee
fix(ws): reconnect after a drop, concurrent queries and per-query abort
332c911
- 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.
@codecov-commenter

codecov-commenter commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ 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).

Files with missing lines Patch % Lines
src/drivers/connection.ts 76.47% 4 Missing ⚠️
src/drivers/database.ts 40.00% 3 Missing ⚠️
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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Gioee added 2 commits October 29, 2026 15:39
@Gioee
fix(ws): tell the gateway when queries are concurrent
fce3980
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.
@Gioee
fix(ws): ask for a stateless gateway connection with websocketStatele…
adb9d45
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

2 participants

@Gioee @codecov-commenter
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.