mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 00:41:09 +02:00
- 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> |
||
|---|---|---|
| .. | ||
| svelte | ||
| sync | ||
| collection.ts | ||
| database.ts | ||
| index.ts | ||
| store.ts | ||
| types.ts | ||