CNA-PLAT-011: Under Emscripten nothing mounts a persistent file system, so saves and the local gamer-services store are lost on page reload
Evidence basis: source-verified at the pinned commit; inferred from the source (the behaviour was not run). Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
No IDBFS mount or FS.syncfs call exists in the tree, so storage writes go to Emscripten's in-memory file system.
- Identifier
CNA-PLAT-011- Category
- Platform limitation
- Subsystem
- Storage
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Evidence basis
- Inferred (strong): follows from the code, but the behaviour was not run
- Tests touching this area
- None
- Affected contract
- StorageDevice/StorageContainer and LocalGamerServicesStore in Emscripten builds
Expected behaviour
Save data should survive a reload of the page, as it survives a restart elsewhere.
Actual behaviour at TARGET
A search of the TARGET tree (third_party excluded) for IDBFS, syncfs, FS.mount and -lidbfs.js finds nothing, and StorageContainer.cpp has no Emscripten branch; files are written to MEMFS and vanish with the page.
The browser can persist files through IDBFS, but that needs a mount and explicit FS.syncfs calls at points only the application knows; CNA does neither, so a game gets the default in-memory file system of the Emscripten build. It is filed as a platform limitation because the default behaviour is the toolchain's, and the workaround below is to lift it in the embedding page.
Source locations
modules/storage/src/StorageContainer.cpp— no Emscripten persistence branchmodules/storage/src/StorageDevice.cpp— storage root resolution, no IDBFS mount
Evidence
Checked by grep and reading at 009d40f5; nothing was built for or run in a browser.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
No web storage test exists.
Regression test
A browser test that writes, reloads and reads back, once an IDBFS mount and syncfs are added.
Blast radius
Every web build that saves games, settings or local achievements.
Workaround
Mount IDBFS and call FS.syncfs from the embedding page's JavaScript.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- Storage guide
- Deep dives
- Web build: storage
- Known issues
- Platform limitation index