Skip to content

Batch: client-db seeding, sign-in identity, drive sync and vocab fixes - #1844

Merged
joepio merged 13 commits into
developfrom
trekmeester/combined-20260925-b4
Sep 25, 2026
Merged

joepio merged 13 commits into
developfrom
trekmeester/combined-20260925-b4

Conversation

@joepio

@joepio joepio commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Before: six ready PRs each wait for their own Mancave run, and most have never been tested at all.

After: they land together once this batch is green on Mancave.

Included (heads as merged):

How: each head was merged with --no-ff. CHANGELOG conflicts took both sides. .po conflicts took develop's side and were then re-extracted; none of the PRs carried translated strings. The lib builds, data-browser tsc is clean, and pnpm run -r lint passes.

Taken out after run 4643: #1782. Its own specs fail on every retry: drive-template-onboarding.spec.ts:5 and :204, and template-recovery.spec.ts:9 and :62. The PR removes the "Template preview" region and no longer shows "Name your drive" in the Setup region, but its specs still wait for both. The branch was rebuilt without it, so run 4643's result no longer applies.

Left out: #1777, #1779, #1780, #1784 and #1772 go into the next batch (they were just rebased onto develop). #1786 conflicts with develop.

joepio and others added 13 commits September 25, 2026 04:18
A recovery backup saved before the did:ad: to atomic: rename names the
agent as did:ad:agent:..., and a secret exported before it still decodes
to that spelling, while a newer one decodes to atomic:agent:.... The
reconcile gate and the secret sign-in compared the strings, so one agent
looked like two: opening the app while signed in to atomic.place archived
the local identity and sent the user to sign in, and signing in with the
secret then ended the account session, which signs out of atomic.place
too because the session cookie is shared.

#1664 fixed the same comparison inside recovery.ts. Export its sameAgent
and use it in reconcile.ts, the secret sign-in's conflicting-session
check, and the two places that match the cached backup to the agent.
A vault restore writes the drive into the local database only. The store
still held the lookup from before the restore: a "not found" from the
node, or "not available locally" without one. `getResource` returns a
cached error as is, so sign-in's check right after the restore read the
old answer, concluded the device had nothing, and let `openPrivateHome`
create a new home over the restored drive. When it did not, the drive
kept the stale error through every later save, and the sidebar showed
its raw subject instead of its name.

`restoreFromVault` now reloads the drive and its agent once the import
has written something, local database first, the way the Sync page
restore already did through `reopenRestoredDrive`.
… doc

On a page's first database start, the seed copies what the store already
holds into the new database. It sent only JSON-AD, so the database rebuilt
each document from its propvals under a fresh peer id: the same values,
but a version vector the server reads as ahead of its own. The next full
drive reconcile then asked the tab to push those documents back.

For a read-only member that push is refused as a whole. In e2e.spec.ts:106
the invitee's tab holds the drive's ontology before its own database
opens, and about one run in three the server named that ontology in
`pull` (client 24 ops under one new peer, server the same 24 ops under the
owner's two peers), which ended in "SYNC_PUSH rejected ... has no write
right on the drive".

A resource with a Loro document is now written with its snapshot
(`putResourceWithSnapshot`), so the database keeps its real history.
Resources without one still go in one batch, properties first as before.
A signed fetch carries x-atomic-* headers, which are not CORS-safelisted,
so every cross-origin vocabulary GET needed a preflight. GitHub Pages
answers that preflight with 405, costing one failed request and a console
error per term per session.

fetchResourceHTTP now signs only requests to the own server: the store's
server URL, a drive on one of its subdomains, or the page's origin (legacy
origins keep their existing signing). Anything else is a plain GET with
only the safelisted Accept header.

Closes #1837

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fetchResourceHTTP signed the request before swapping in the /path proxy
URL, so the signature covered the external subject while the server
verified it against the proxy URL it received, and refused it (401).
Build the proxy URL first and sign exactly that.

When a direct fetch of a foreign plain document fails (network, CORS,
5xx), the Store now retries once through the own server's /path proxy,
which fetches and keeps external vocabulary. The answer takes the same
applyIncoming path as a direct one, so it is cached the same way. An
origin the proxy served goes to the proxy first for the rest of the
session; if that fails, the origin itself is tried once. Queries,
collections, POSTs and the own server are never proxied.

5xx responses other than 500 are now typed as server errors too.

Closes #1838

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	browser/CHANGELOG.md
#	browser/data-browser/src/locales/de.po
#	browser/data-browser/src/locales/en.po
#	browser/data-browser/src/locales/es.po
#	browser/data-browser/src/locales/fr.po
# Conflicts:
#	browser/CHANGELOG.md
# Conflicts:
#	browser/CHANGELOG.md
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