andrewosh / mountable-hypertrie

A Hypertrie wrapper that supports mounting of other Hypertries
MIT License
26 stars 9 forks source link

ensure parent is ready when creating subtrie #2

Open Frando opened 4 years ago

Frando commented 4 years ago

I run into a situation where a subtrie is being created (as response to creating or opening a mount, through hyperdrive) while this.key is not yet set, which means ready thunk has not completed.

The problem is - as things are currently this is hard to recover, becaues the corestore will record wrong dependencies for the cores of the subtries, which makes them not replicate with the parent.

Here it is ensured that the trie has a key before opening subtries.