Io.open getting stale data on HTML5

The JS code that is bundled with the default HTML template, synchronises data from the IDB to memory at start, then syncs from memory to IDB after each file close. This means that there will not be any automatic IDB->memory syncs after the initial one.

But this is maybe something you could trigger yourself, check out FS.syncfs() in the emscripten documentation. As previously stated, we call this essentially after each file close, with the first parameter set to false (this syncing from IDB->memory).

And as you pointed out, you are using the underlaying filesystem functionality in ways not intended (by Defold at least), so you are doing this at your own “risk”. But it sounds fun, let us know how it goes! :wink:

5 Likes