mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:01:08 +02:00
The race-window `getOrCreateLocalDoc()` fallback in userContextStore + kontextStore stays (without it, a write that lands between "endpoint provisioned the singleton in mana_sync" and "first pull landed it in IndexedDB" would hit `update(missing-id, diff)` — a Dexie no-op that silently swallows the user's edit). But it was semantically lying: the insert stamped `origin='user'` even though the row is logically a client-side replica of the server-side bootstrap. This commit adds `SYSTEM_BOOTSTRAP = 'system:bootstrap'` to `@mana/shared-ai` and wraps the two fallback inserts in `runAsAsync(makeSystemActor(SYSTEM_BOOTSTRAP), ...)`. The Dexie hook now stamps `origin: 'system'` on the empty-row insert — structurally identical to the row mana-auth's bootstrap-singletons.ts writes. When the server's pull arrives later both sides carry the same origin and the conflict-gate stays quiet. The user's subsequent writes still stamp `origin: 'user'` on the changed fields. Plan: docs/plans/sync-field-meta-overhaul.md (F4-fu Fallback-Origin row). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| package.json | ||
| tsconfig.json | ||