managarten/packages/local-store/src
Till JS 28942abede fix(mana/web): sprint 2 — auth-aware data layer + guest migration
- Single source of truth for the active user via data/current-user.ts;
  layout pushes authStore.user.id into it on every auth state change.
- Dexie creating-hook auto-stamps userId from getEffectiveUserId(); the
  updating-hook strips userId from modifications so records are
  effectively user-immutable after creation.
- BaseRecord gains an optional userId so module types inherit it without
  per-module declarations. All hardcoded 'guest'/'local' fallbacks in
  module type-converters and session timer stores are deleted; the dead
  userId field is removed from the public view types where it was
  unused (Task, Conversation, Template, Deck, Plant, Contact, etc.).
- New guest-migration.ts: on first authenticated session, walks every
  sync-tracked table, deletes guest-owned records and re-adds them so
  the creating-hook re-stamps with the real user id and produces fresh
  insert pending-changes with the full payload. Stale guest pending-
  changes are cleared up-front.
- Drive-by: root onMount now returns its cleanup synchronously; the
  previous async form silently dropped the cleanup callback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:07:12 +02:00
..
svelte feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
sync feat(local-first): add local-first architecture with Dexie.js, Go sync server, and Todo pilot 2026-03-27 11:17:58 +01:00
collection.ts feat(todo): wire up browser sync with Go server 2026-03-27 11:55:32 +01:00
database.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
index.ts feat(local-first): add local-first architecture with Dexie.js, Go sync server, and Todo pilot 2026-03-27 11:17:58 +01:00
store.ts feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
types.ts fix(mana/web): sprint 2 — auth-aware data layer + guest migration 2026-04-07 13:07:12 +02:00