Repository navigation
Move Reader and the extension to SDK 0.1.0-beta.188 - #179
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
createMdbaseis the only entry; reads take one options object; record values are plain JSON; status comes fromsnapshot.sync. Across the extension's RPC bridgeauthorizeis nowsignIn.fetchoverride deleted: the SDK sends every request withcredentials: "omit". The overrides in extension pages and the page-status worker stay, because they also cover Reader's own fetches.snapshot.syncinstead of the ready phase's connection status.sdk-v0.1.0-beta.188release assets, unchanged. I verified their sigstore bundles withgh attestation verify: signed bypublish-sdk-npm.ymlatrefs/tags/v0.1.0-beta.188, sourcee8ffb806. 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:workspacespasses (Reader 1122, extension 333, connect 345, and the rest).sigstoremodule of CI's npm, which my machine's npm lacks; CI runs them.pnpm i18n:check,pnpm buildand the extensionpackagepass.Not done
session: { build, host }) could replace it; that is a separate change.@mdbase-dev/connectuse is untouched, so this overlaps Drop legacy @mdbase-dev/connect dependencies #145 and Reader: adopt SDK beta.159 and shared UI beta.158 #142, which will need a rebase.pnpm install --lockfile-onlywith this repo's pnpm moved unrelated versions, so I did not use it.