Skip to content

Move to SDK 0.1.0-beta.188 and its new API - #40

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

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

Conversation

@callumalpass

Copy link
Copy Markdown
Contributor

What

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

Changes

  • API move, behaviour unchanged: createMdbase is the only entry; reads take one options object; submit resolves one Write; record values are plain JSON; status comes from snapshot.sync.
  • Deleted test stubs: peer tabs connect with the testing kit's replica.client(), and the Journal contract is declared on the replica instead of stubbing describe.
  • "Reconnecting" notice: shows in the same moments as before (no network, or a service that does not answer), not while a replica is still connecting.

A user could notice

  • A refused save shows the problem's title only, where it showed a longer message.
  • A refused first save clears the attempt.

Checks

  • npm run typecheck, npm test (245 pass), check:release-downloads, test:release-downloads.
  • test:publisher: 147 pass. Two tests and build:ci need the sigstore module of CI's npm, which my machine's npm lacks; CI runs them.

Not done

  • One peer-tab describe stub remains in tests/autosave-ownership.test.ts: without it a follower tab does not reopen its record session after "Use saved version". Cause not found.
  • npm run build:local fails on main too ("Installed SDK drift"); not touched here.

- Client reads take one options object: describe({signal}),
  pages(query, {signal}), get(ref, {include, signal}).
- Record values are plain JSON: frontmatter[field] and a contract
  implementation's fields[name], typed with the root's plain
  DescribeResult and RecordView instead of wire types.
- client.settle replaces client.save for the first create. A refusal is
  still definite and clears the create attempt; an unknown outcome reads
  the original record by its pinned ID as before.
- Status: snapshot.writes is snapshot.sync.writes, and the replica-offline
  check reads sync.connection (offline or reconnecting) in place of the
  removed StatusSummary.kind. StatusSummary.text is gone, so a live
  service refusal shows its describeError title.
- Tests: the fixture's mdbase replaces entry/application,
  ApplicationFixtureSnapshot replaces MdbaseApplicationSnapshot, connect
  comes from @mdbase-dev/sdk/thin-client, and summarizeStatus is gone.
MemoryReplica.client() is the testing kit's own non-reconnecting client over the replica, so the tests no longer assemble connect() from the thin-client entry.
…g describe

The testing kit's MemoryReplica now answers describe with the declared contracts and the types that implement them, so the fixture declares journal.entry once and twelve tests drop their describe stubs. Stubs that control when or what describe answers stay, and so does the peer tab's stub in the autosave-ownership tabs: without it the two cross-tab conflict tests never reopen the follower's session.
The old offline status maps to connection "offline"; a replica that is still
connecting did not raise the notice.
@callumalpass
callumalpass merged commit af47918 into main Nov 12, 2026
1 check passed
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