IDBStorageEnabled = true , load gltf and bin, still use old indexDB data when version +1 in manifest file from server

Then something is wrong with the manifest parsing, but without a reproduction we can’t help.

1 Like

It can be repeated after multiple consecutive loads.

In server:
version of v2 is 8
version of v3 is 1

version in IndexedDB:
all is 1


61fe38509d6382e3612d18348f63cb38
image

Yes, this happens because the manifest was meant for an entire scene and not really per model. The state is stored in the database and not per request. You are loading two assets with two different manifest versions. In this case there might be a race condition due to the async nature of the database.

But this is not related to your initial question, right? This is a design issue that concerns a very old (and TBH reliable) system that was designed for something a bit different.

There is an open feature request to modernize the offline support and the database class:

So far there is not a lot of traction, but you are more than welcomed to express your opinion there.

In the meantime - make sure all models loaded on a specific page have the same manifest version OR load them one after the other. Again, the manifest was meant as a way to load an entire scene (the .babylon file format to be more exact).

database.zip (5.7 KB)
I tried to change it. Now, most of the bin and image files have normal version numbers, but many gltf files cannot be cached in IndexDB, and I find that they are not run in the loadFile function, but I don’t know reason. Because I don’t know how to use vscode to break points debugging in node_moudles.

When the version numbers of the bin and image files were correct, my previous error was resolved. This is because the bin file in IndexDB was not updated correctly.