Skip to content

Move Reader and the extension to SDK 0.1.0-beta.188 - #179

Merged
callumalpass merged 6 commits into
mainfrom
feat/sdk-polish-migration
Nov 12, 2026
Merged

callumalpass merged 6 commits into
mainfrom
feat/sdk-polish-migration

Conversation

@callumalpass

Copy link
Copy Markdown
Contributor

What

Moves Reader and the browser extension to @mdbase-dev/sdk@0.1.0-beta.188, whose API changed (mdbase-connect #1486). The first commit is the automation's production repin from #178, unchanged; the rest moves the code. #178 cannot pass by itself.

Changes

  • API move, behaviour unchanged: createMdbase is the only entry; reads take one options object; record values are plain JSON; status comes from snapshot.sync. Across the extension's RPC bridge authorize is now signIn.
  • Offscreen host's fetch override deleted: the SDK sends every request with credentials: "omit". The overrides in extension pages and the page-status worker stay, because they also cover Reader's own fetches.
  • Sync incidents are read from snapshot.sync instead of the ready phase's connection status.
  • Offline reads as before: no network or an unreachable service. A busy or rate-limited service is not offline.
  • LAB and staging SDK originals → beta.188. They were at beta.157 and the migrated code does not build against that. Both archives are the sdk-v0.1.0-beta.188 release assets, unchanged. I verified their sigstore bundles with gh attestation verify: signed by publish-sdk-npm.yml at refs/tags/v0.1.0-beta.188, source e8ffb806. The bundles are stored prettier-formatted, as the repo stores the others, and verify in that form. The beta.157 archives, pins and bundles are removed.

Checks

  • pnpm install --frozen-lockfile, lint, format, architecture and typecheck pass.
  • pnpm test:workspaces passes (Reader 1122, extension 333, connect 345, and the rest).
  • Publisher node tests: 163 pass. Two need the sigstore module of CI's npm, which my machine's npm lacks; CI runs them.
  • pnpm i18n:check, pnpm build and the extension package pass.
  • I did not run the browser suites locally; CI runs them here.

Not done

Behaviour is unchanged; this is the step-1 port to the next @mdbase-dev/sdk
release (mdbase-connect PR #1486).

- One entry: the extension's offscreen host builds `createMdbase` and serves
  `Mdbase` itself; `authorize` is `signIn` across the RPC bridge.
- Reads pass one options object (`{ include, signal }`, `{ timeoutMs, signal }`),
  and `watchChanges` takes the callback first.
- Record, contract, query-group and issue values are plain JSON: drop the
  `plain`/`toPlain` unwrapping and the `instanceof Map` checks that would now
  silently skip validation and incident details.
- Status reads `snapshot.sync` (`connection`, `attention`, `writes`) instead of
  `snapshot.sync.kind` and `snapshot.writes`; `summarizeStatus` was unused.
- Tests use `replica.client()` and the fixture's `mdbase`.
The SDK now sends every request with credentials: "omit" (mdbase-connect
changelog sdk-omit-credentials). In the built offscreen bundle the only other
fetch is Vite's preload of the extension's own assets, so replacing the
realm's fetch there no longer changes any request.

The overrides in extension pages (mount.tsx) and the page-status worker stay:
they also cover Reader's own fetches, such as the PDF capture fallback in
page-capture.ts, which the SDK does not make.
sdkSyncIncidents dug the replica's incidents out of the ready phase's
connection status. The SDK's snapshot.sync carries the same list (it is
summarised from that connection's records.status and is null until the
collection is ready), so read it there and drop the phase type gymnastics.
The old offline status is no network or an unreachable service; a busy or
rate-limited service is not offline.
@callumalpass
callumalpass merged commit bba3aa5 into main Nov 12, 2026
3 checks passed
@callumalpass
callumalpass deleted the feat/sdk-polish-migration branch November 12, 2026 22:50
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