Files
workinf_Blender_Wasm/docs/status/W-042.md
2026-08-12 04:47:48 -04:00

17 lines
978 B
Markdown

# W-042 Status
status: done
task: 保存 `.blend` 原子事务
StorageWorker `saveProject` accepts a transferable ArrayBuffer, creates the
OPFS project layout, writes and SHA-256-verifies `scene.blend.<uuid>.stage`, records a
recovery journal, and uses same-directory move (or a complete-copy fallback) before re-verifying
`scene.blend`. Only then does it write the manifest, clear the journal and update the IndexedDB
`project` record with revision, byte count, digest, backend and timestamp.
The React Save command now submits this transaction before downloading the
`.blend` Blob, and keeps the StorageClient alive for the project session.
When OPFS is unavailable, the record stores the buffer in IndexedDB instead.
Playwright injects failures after staging and after scene commit, restarts the Worker, and verifies
exact bytes/revision/digest through `readProject`. Concurrent same-project saves are serialized and
the last submitted revision wins without journal races.