There is something wrong about the preload flag logic for keyvalue stores. The way I understand the preload flag is that if set to true it will preload the data from the store so the app already have it when it is requested. preload flag is true by default so my expectation is that something like _getAllFromUrbit() must be invoked by default during the initialisation. However, the code only calls subscribeAll() and I can't see anything that change the loaded flag to true. The result is that if I call the all function immediately after the initialisation I get the endless setTimeout in waitForLoaded():
const db = await Tome.init(api);
const store = await db.keyvalue();
const result = await store.all() // this one never completes
If this is not a valid use of the library maybe the documentation can be improved to state that.
There is something wrong about the
preloadflag logic forkeyvaluestores. The way I understand thepreloadflag is that if set to true it will preload the data from the store so the app already have it when it is requested.preloadflag is true by default so my expectation is that something like_getAllFromUrbit()must be invoked by default during the initialisation. However, the code only callssubscribeAll()and I can't see anything that change theloadedflag to true. The result is that if I call theallfunction immediately after the initialisation I get the endless setTimeout inwaitForLoaded():If this is not a valid use of the library maybe the documentation can be improved to state that.