Skip to content

Sync through the mdbase desktop app with the new SDK - #30

Merged
callumalpass merged 3 commits into
mainfrom
feat/next-sdk
Oct 25, 2026
Merged

callumalpass merged 3 commits into
mainfrom
feat/next-sdk

Conversation

@callumalpass

@callumalpass callumalpass commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Replaces the connect-sync beta.120 directory mirror with the mdbase desktop app's sync. The plugin no longer syncs files itself. It signs in, turns sync on (Cloud copy or Private), adds collections from a link, and shows live status and decisions. It does this through the app's mdbase --json tool and the SDK's localhost link (@mdbase-dev/sdk/thin-client, vendored tarball, loaded on demand, no wasm).

This changes sign-in and how the plugin connects to the app. The plugin holds no credentials: it shells out to the mdbase tool and uses the SDK thin-client link.

What changes for people

  • Sync tab
    • One plain-words status, shared with the status bar and settings: synced, sending, offline, Private on a second computer, app stopped, signed out, sign-in broken.
    • Setup offers Cloud copy (recommended) or Private.
    • "Add a collection you already sync" takes a pasted link. An empty vault becomes the collection; otherwise it goes into a new folder.
  • Sign-in opens the browser and offers Copy sign-in link in case no browser opens. Sign-in from settings hands off to the Sync tab.
  • Decisions
    • Files changed in two places offer Keep this computer's, Use the other version or Keep both.
    • Merges mdbase made on its own are listed as "changes to check", with Use "" or OK.
  • Open notes receive edits from other devices without the cursor moving.
  • Settings has disconnect (behind a confirmation that notes stay on this computer) and the app location. Sign out is hidden until the server fix for signing in again on the same computer (mdbase-connect #973) ships.
  • Mobile keeps types and validation. Sync says it needs a computer.
  • Removed: the mirror engine, sync history, preview/review ledger, attachment and folder-exclusion settings, and their styles, docs and tests (about 20k lines).

Size

main.js drops from 829,487 B to 690,599 B raw (213 KB gzip). check:mobile passes.

Testing

  • 123 unit tests, lint and check:mobile pass.
  • End-to-end on two Linux desktops against a test environment:
    • sign-in from a fresh install, sign out, sign in again;
    • Cloud copy and Private setup;
    • two-vault sync including open notes and concurrent typing;
    • app stopped and started;
    • offline and reconnect;
    • body and property conflicts (Keep both, Use the other version);
    • merged-change review;
    • attachments (PNG, PDF, 3 MB binary, byte-identical);
    • 2,000-note create plus 2,000-note edit;
    • error paths (bad link, unknown collection, folder in use, collection already on this computer);
    • light and dark themes;
    • phone layout.
  • Private works on the first computer only for now: a second computer can't be approved yet, because approvals happen in the mdbase app's own window and that window isn't part of this build of the app. Setup and join say so, and a second computer shows that plainly instead of "Waiting for approval". Cloud copy has no such limit.

Supersedes #29 and #12.

mdbase-test-vault/ is a small local collection (book, person and note types)
with valid records, one record that breaks every rule of its type, and one
typed only by its path. A unit test validates it so it keeps meaning what its
notes say.
Replace the connect-sync beta.120 directory mirror with the mdbase desktop
app's sync. The plugin no longer syncs files itself: it signs in, turns sync
on (Cloud copy or Private), adds collections from a link, and shows live
status and decisions through the app's command-line tool and the SDK's
localhost link (@mdbase-dev/sdk thin-client, loaded on demand, no wasm).

- Sync tab: plain-words status from one summary shared with the status bar
  and settings; setup with Cloud copy or Private; add a collection from a
  link (an empty vault becomes the collection, otherwise a new folder);
  sign-in with a copyable link; offline, stopped app, waiting for approval,
  declined link and broken sign-in each say what to do.
- Files changed in two places are listed with Keep this computer's / Use the
  other version / Keep both; merges mdbase made on its own are listed as
  changes to check, with a way to use the other value.
- Edits from other devices land in open notes without moving the cursor.
- Settings: sign out and disconnect behind confirmations, app location.
- Mobile keeps types and validation; sync says it needs a computer.
- Remove the mirror engine, sync history, preview/review, attachment and
  exclusion settings, and their styles, docs and tests (about 20k lines).
- main.js drops from 829 KB to 691 KB (213 KB gzip).
Signing in again on the same computer breaks sync there until the server
fix (mdbase-connect #973) ships, so the settings Sign out button is hidden
until then. A Private collection can't be approved on a second computer
yet: setup and join say so, and a second computer shows that plainly
instead of waiting for an approval that can't come.
@callumalpass
callumalpass merged commit 25caf9f into main Oct 25, 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