mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 01:41:08 +02:00
fix(questions): unwrap \$state proxy for tags before Dexie write
Creating a new question crashed in mana-sync's pending-change hook with DataCloneError because the tags array is a Svelte 5 \$state proxy and IndexedDB / structured-clone can't serialize proxies. Surfaced while clicking through the deep-research feature end-to-end in the browser — the form would silently fail to submit with the error buried in the console. Use \$state.snapshot() to deep-clone tags into a plain array before persisting. Other fields are primitives so they're already plain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
74140e1154
commit
6fd4655273
1 changed files with 5 additions and 1 deletions
|
|
@ -71,7 +71,11 @@
|
|||
description: description.trim() || null,
|
||||
status: 'open' as const,
|
||||
priority,
|
||||
tags,
|
||||
// Unwrap the Svelte 5 $state proxy — Dexie / mana-sync's
|
||||
// _pendingChanges hook structured-clones the row and proxies
|
||||
// throw DataCloneError. $state.snapshot() returns a plain
|
||||
// deep copy.
|
||||
tags: $state.snapshot(tags),
|
||||
researchDepth,
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue