Skip to content

feat(sdk-kmp): build against meshtastic-sdk main and let Dependabot bump it - #1545

Draft
danditomaso wants to merge 3 commits into
meshtastic:mainfrom
danditomaso:feat/sdk-track-upstream-main
Draft

danditomaso wants to merge 3 commits into
meshtastic:mainfrom
danditomaso:feat/sdk-track-upstream-main

Conversation

@danditomaso

Copy link
Copy Markdown
Collaborator

Description

The SDK submodule follows a fork branch (danditomaso/meshtastic-sdk feat/storage-sqldelight-js), which moves only when someone pushes to it. Because of that the web client doesn't pick up SDK changes, and Dependabot's submodule bumps were turned off after #1534. Upstream main now carries the browser storage work, so this PR moves the facade onto it and turns automatic bumps back on.

Draft. It depends on:

Changes Made

Architecture: sdk-kmp facade

  • Build against meshtastic/meshtastic-sdk@5e81355 (main). The storage sources are identical to the fork's, so existing OPFS databases open the same way.
  • Map the new connection states Disconnecting, Failed (with its cause's message and kind) and DeviceSleeping to "disconnecting", "failed" and "sleeping".
  • The SDK now retries even the first connect unless the transport reports a non-recoverable error. The client hands the SDK a per-attempt provider. The browser transports report a failed connect() as non-recoverable on attempt 0 only. So a connect whose transport can't open (API missing, device not permitted, LNA denied) still fails at once, and drops of a live session are still retried.

Behaviour changes

  • useConnections now reads the SDK giving up from failed. It used to infer that from disconnected arriving after reconnecting.
    • Hitting the attempt cap reports "Could not reconnect after N attempts."
    • Any other cause goes through connectFailure.
  • A disconnected that follows disconnecting was requested, so it settles on disconnected instead of "connection lost".
  • A sleeping radio shows as connecting while the SDK waits for it.
  • A handshake that stalls after the transport opened (timeout or protocol error) is now restarted by the SDK, up to the attempt cap, instead of failing the first connect at once. The connection shows the reconnect attempts in the meantime.
  • Send failures: GOT_NAK now arrives as "GOT_NAK" (upstream js version bump #297) instead of no-route, and the message status maps it by routing-error name.

Chores

  • .gitmodules now points at meshtastic/meshtastic-sdk main.
  • Dependabot's weekly gitsubmodule update is back. Dependabot reads the branch from .gitmodules.
  • A bump that breaks the facade fails build-and-package. Fix it on the Dependabot branch instead of merging it red. Documented in packages/sdk-kmp/README.md.

Testing Done

  • pnpm --filter @meshtastic/sdk-kmp build, and jsNodeTest passes (48 tests).
  • pnpm vitest run passes (2251 tests). Updated for the new states:
    • serialClient.test.ts: a connect that can't find a port ends in failed.
    • useConnections.kmp.test.ts: cap exhaustion, a non-retryable cause, a cause between attempts, a requested disconnect while reconnecting, and a sleeping radio.
    • fakeClient.ts: a disconnect passes through disconnecting.
  • apps/web vite build passes. Typecheck adds no errors beyond the ones already on main.
  • Not tested yet against real HTTP, serial or BLE radios.

Moves the pin from 206bcdc to 9f63c9c, the head of feat/storage-sqldelight-js.

The SDK failed every handshake whose get_owner_response did not arrive
within 10 s, so radios with a large NodeDB over HTTP, and managed radios
(firmware drops local admin when is_managed is set), never connected:
"Handshake timed out during stage: Seeding Session". The session now goes
Ready at the Stage 2 completion, the passkey seed only warns on timeout,
and the handshake logs the local node's is_managed flag. A late Stage 1
completion from the want_config retry no longer fails Stage 2 as a nonce
mismatch.

The new head also adds SendFailure.QueueFull, mapped here to "queue-full".
Moves the SDK to meshtastic/meshtastic-sdk@5e81355 (main), which carries the
browser storage work and the non-fatal session seed (meshtastic#286) the fork branch
was holding.

- Map the new connection states: Disconnecting, Failed (with its cause's
  message and kind) and DeviceSleeping, as "disconnecting", "failed" and
  "sleeping".
- The SDK now retries even the first connect unless the transport reports a
  non-recoverable error. The client passes a per-attempt provider and the
  browser transports report a failed connect as non-recoverable on attempt 0
  only, so a connect the user starts still fails at once when the transport
  cannot open, as before. A handshake that stalls or fails after the
  transport opened is now restarted by the SDK, as for a live session, up to
  the attempt cap, and the connection shows the reconnect attempts meanwhile.
- useConnections reads the give-up from "failed" instead of inferring it
  from "disconnected" after "reconnecting": the attempt cap reports
  reconnectFailed, any other cause goes through connectFailure. A
  "disconnected" that follows "disconnecting" was asked for and settles on
  disconnected rather than connection lost. A sleeping radio shows as
  connecting while the SDK waits for it.
Point the submodule at meshtastic/meshtastic-sdk main instead of the fork
branch, and bring back Dependabot's weekly gitsubmodule update. CI builds
the facade against each bump, so one that changes an API the facade uses
fails there and gets its facade changes on the Dependabot branch.
@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

@danditomaso is attempting to deploy a commit to the Meshtastic Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant