mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:01:09 +02:00
Schicht A Etappe 1 of the workbench-seeding-cleanup plan: every module store that writes to a space-scoped Dexie table now sets `spaceId` explicitly via `getEffectiveSpaceId()` instead of relying on the creating-hook's silent auto-stamp. Etappe 2 (flip the hook to throw on missing spaceId) follows after a soak day. New helper: - `data/scope/scoped-db.ts` — `getEffectiveSpaceId()` returns the active Space's id when one is loaded, falling back to the personal sentinel `_personal:<userId>` for guests / pre-bootstrap windows. Symmetric with `getEffectiveUserId()`. Re-exported from `data/scope/index.ts`. Migrated call sites (16 writes across 10 modules): picture: boards, boardItems events: eventGuests, eventItems companion: companionConversations, companionMessages calc: savedFormulas, calculations quotes: quotesFavorites, customQuotes skilltree: skills, achievements moodlit: moods plants: wateringSchedules questions: answers (manual + research-driven paths) data/ai: agents, agentKontextDocs The audit also flagged `_serverIterationExecutions`, but it's an internal infra table (leading underscore, not in SYNC_APP_MAP, never synced) — the creating-hook doesn't run on it, so no change needed. No behaviour change today: the hook still falls through to sentinel- stamping when spaceId is missing, so existing rows + any unmigrated caller keep working. Etappe 2 flips that fallback to a hard error, turning silent omissions into write-time failures. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| calc/packages/shared | ||
| calendar | ||
| cards | ||
| chat | ||
| citycorners | ||
| contacts | ||
| context | ||
| docs | ||
| food | ||
| guides | ||
| inventory | ||
| mana | ||
| manavoxel | ||
| memoro | ||
| moodlit | ||
| mukke | ||
| news | ||
| photos | ||
| picture | ||
| plants | ||
| presi | ||
| questions | ||
| quotes/packages/content | ||
| skilltree | ||
| storage | ||
| times | ||
| todo | ||
| traces | ||
| uload | ||