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

babylon version: 7.22.3
load api: SceneLoader.ImportMeshAsync
file: scene.gltf , scene.bin , other textures.

When I use IDBStorageEnabled = true, load scene.gltf(with scene.bin) from server, the scene.gltf.manifest In the same folder:
{
“version” : 1,
“enableSceneOffline” : false,
“enableTexturesOffline” : false
}

I can load it successful.
Then, I update scene.gltf and scene.bin in server , and change scene.gltf.manifest :
{
“version” : 2,
“enableSceneOffline” : false,
“enableTexturesOffline” : false
}

Now , load scene.gltf unsuccessful:
Uncaught (in promise) Error: Unsupported geometry type.
at decodeMesh (dc4aae5c-806a-4cda-8212-54a29bfc79be:37:17)
at dc4aae5c-806a-4cda-8212-54a29bfc79be:130:29

Then I Delete indexedDB data from browser, I can load scene.gltf successful!

I speculate that when the gltf model version on the server changes, the front end does not load the latest bin file correctly, resulting in the new gltf file and the old bin file.

IDK if indexedDB has a cache mecanism. I guess it’s more on the browser side?
cc @RaananW

We have a caching system based on indexedDB.

@HouLingLXH , would you be able to reproduce that on the playground so I can trace the source of the wrong call? I am pretty sure you are right we just need to see where we make the call that skips the caching mechanism.

1 Like

You need change your assets path, and update it to test.

Update:
use same name model(gltf + bin ) to replace old model in server,
change version (+1) in manifest

Test
replay

now you load the new manifest with new version, but, load the old mesh to scene.

if I move from v2 to v3 it works as expected. At what version does it fail?

quick note - v3 seems to not render correctly, however it does load without an error. This is unrelated to the database. even if I load v3 standalone after emptying the database the same thing happens.

Tell me exactly what you did

You need to load your gltf from your server, then change the gltf and manifest file to test, instead of change “https://raw.githubusercontent.com/HouLingLXH/publicAssets/master/bblPG/testIndexDB/v2/” to “https://raw.githubusercontent.com/HouLingLXH/publicAssets/master/bblPG/testIndexDB/v3/

When version +1 in scene.gltf.manifest, only update new scene.gltf to indexedDB, but the .bin file is not update. Then load scene.gltf , will use old .bin, This is the problem…

I am trying to follow, but can’t really understand what I am doing wrong. There should be no difference if I deploy this on a server, or use the github link. For both it’s a new URL (for me). What exactly do I need to do to reproduce this? Using the links you have provided. Step by step please, so I will be able to reproduce this correctly.

Why load gltf from your server?

Because then you can update the gltf(with bin) files on the server(gltf and bin need different, but has same name),and change the manifest file, to simulate the model on the server has been updated.

The bug is model on the server has been updated, but babylon load the new gltf with old bin file in indexedDB.

Use the same url(same name) to load different gltf(with bin) .

Do any other members of your team know about IndexDB to solve this problem?
The issue occurred after the server updated gltf and bin, babylon could not load the new model with the same name correctly.
If someone understands the purpose of IndexDB during server model updates, they should be able to understand how to reproduce and fix it.

i am assigning it to me and will look into by the end of the week.

Just wanted to follow up on this - i downloaded everything, copied and served from my own server, and everything is workign as expected.

I wanted to note - your model v2 has manifest v4 (and both flags on, as opposed to the original message), and the v3 has manifest v3. This will not work, manifest versions should increment. I will try once again to reproduce, but so far, the models both load correctly, when copying the manifest and the files.
On another matter, i would personally try to avoid naming all of my scenes “scene.gltf”, especially if they are a completely different model, but this is just a personal taste thing :slight_smile:
Again - i can’t reproduce, but will continue trying.

Why am I naming different models the same “scene.gltf”?
Because I need to simulate the same model being updated on the server!
This problem occurs because the server model has been updated, and since it is updated, of course, the files of different models have the same model name.

Note: that [server path A] is a constant, identical server address.

1.Place the model(v2) on the server: url = “[server path A]/scene.gltf”
2.set scene.gltf.manifest:
{
“version” : 1,
“enableSceneOffline” : true,
“enableTexturesOffline” : true
}
3.load it:
BABYLON.SceneLoader.ImportMeshAsync(“”, “[server path A]”, “scene.gltf”, scene);

  1. Delete the model (all files) from the server : url = “[server path A]/scene.gltf”
  2. Place the model(v3) on the server: url = “[server path A]/scene.gltf”
  3. set scene.gltf.manifest:
    {
    “version” : 2,
    “enableSceneOffline” : true,
    “enableTexturesOffline” : true
    }
    7.load it:
    BABYLON.SceneLoader.ImportMeshAsync(“”, “[server path A]”, “scene.gltf”, scene);

8.get error

The point, the core behavior, is that different models are loaded on the same path in a chronological order

So, I’ll be honest and say that until you manage to show me a proper reproduction I can’t really help. I understand everything you are saying, but again, i can’t reproduce. Here is a screencast of me using your assets, locally, in the playground, using the latest babylon version. You will see I am loading the first asset, which loads correctly, afterwards I am copying the files, updating the manifest and running the scene again. This works as well. on the 3rd time I am running the scene again, and the data is loaded from the database, because the manifest version hasn’t changed.

I can’t upload it here since it is too long.

Everything is working as expected. I will never say that we are bug free or that something is working unless I have tested it myself, since we do have bugs from time to time. But this - as far as I can see - is not a bug. But again, if you manage to show me a proper reproduction, I will be happy to look into it again.

BJS - [11:38:13]: Babylon.js v7.35.2 - WebGL2 - Parallel shader compilation

I use Vue3 to load gltf from public, but the all version data in indexedDB is 1


ba83ce0f99e6ffaf190cce61d513a7f0