Skip to content

feat(wslink): upgrade to wslink 2 - #547

Merged
BotellaA merged 4 commits into
nextfrom
feat/wslink_2
Oct 16, 2026
Merged

BotellaA merged 4 commits into
nextfrom
feat/wslink_2

Conversation

@BotellaA

Copy link
Copy Markdown
Member

Upgrades wslink from 1.12.4 to 2.5.0. Wslink 2 replaces JSON with msgpack, sent as chunked binary messages, so it needs the OpenGeodeWeb-Viewer PR on the same feat/wslink_2 branch.

Changes

  • Node server client (server/utils/ws_client.ts): encodes with @msgpack/msgpack and reuses wslink's chunking module (typed by a small wslink_chunking.d.ts shim). Viewer shutdown in cleanup.ts now goes through this client instead of its own raw JSON WebSocket.
  • Viewer shutdown: after sending application.exit, wait for the viewer to close the socket. Wslink 2 handles messages asynchronously, so closing right away dropped the request.
  • Undefined params: msgpack sends undefined as null where JSON omitted the key, which failed the viewer schema validation (e.g. collection_id on model colors). callClient now omits undefined values.
  • Screenshot: blob is now the image bytes (a Uint8Array); the existing Blob wrapping already handles it.
  • Integration tests: each microservice is registered as soon as it runs, and every started project folder is cleaned up after the file, even when its setup failed. Before, a failed setup leaked its back and viewer processes.

Testing

  • Unit: 182 passed
  • Integration: 166 passed, with no leftover processes afterwards

🤖 Generated with Claude Code

Wslink 2 replaces JSON with msgpack, sent as chunked binary messages.

- Port the Node server WebSocket client to msgpack/chunking, reusing
  wslink's chunking module, and route viewer shutdown through it
- Wait for the viewer to close the socket after application.exit:
  wslink 2 handles messages asynchronously, closing right away drops it
- Omit undefined RPC params: msgpack sends them as null where JSON
  omitted them, which fails the viewer schema validation
- Integration tests: register each microservice as soon as it runs and
  clean up started project folders even when the setup fails

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server never reads the "wslink" message version field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BotellaA and others added 2 commits October 16, 2026 11:03
oxlint-tsgolint 7.0.2004 reports a multi-line type assertion at its first
line, so the disable comment above its last line no longer applied.

- Bridge Dexie's liveQuery to rxjs Observable in a liveObservable helper
- Move the WidgetHandle cast to an asWidgetHandle helper
- Await the WebSocket client before casting it to RpcClient

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wslink ships chunking.ts next to its compiled chunking.js, and the
extension-less import resolved to the TypeScript source, which the Nitro
production build cannot parse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BotellaA
BotellaA merged commit 237e7f5 into next Oct 16, 2026
27 checks passed
@BotellaA
BotellaA deleted the feat/wslink_2 branch October 16, 2026 13:05
@JulienChampagnol

Copy link
Copy Markdown
Member

🎉 This PR is included in version 10.40.0-rc.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants