Files
github-actions[bot] 6056656128 [AI] Support custom dataDir in API browser build and stop masking worker errors
Two fixes for the browser build of @actual-app/api:

1. A dataDir other than /documents failed with a cryptic DataCloneError:
   the directory didn't exist in the worker's virtual filesystem, and the
   resulting Emscripten ErrnoError (which carries a function-valued
   property) couldn't be structured-cloned, so postMessage's own
   DataCloneError replaced the real error entirely.

   The web worker connection now retries a failed postMessage with a
   serialized, cloneable copy of the message so the client always receives
   the actual failure. Cloneable errors pass through unchanged.

2. The web filesystem registers the configured document dir as a persisted
   root: it is created automatically on init, its files are persisted to
   IndexedDB (sqlite files symlinked into the blocked fs), and files
   recorded in IndexedDB are restored at boot regardless of prefix. The
   API browser worker defaults dataDir to /documents when omitted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 21:32:22 +01:00
..