I implemented a multiple tile removal like this:
updateTree(
currentNode,
getMosaicPaths(currentNode, nodes).map(path => createRemoveUpdate(currentNode, path)))
I implemented getMosaicPaths that returns a list of MosaicPath, and created list of RemoveUpdates out of them and passed them into updateTree.
Sometimes (not all the times) the updateTree fail because one of the remove updates causes the tree to rebalance, thus the remaining updates cannot proceed because the paths are no longer valid.
Perhaps one way to address it is to disallow rebalancing during the updateTree to ensure the paths it takes in continue to be valid, and then rebalance at the end if needed.
I implemented a multiple tile removal like this:
I implemented getMosaicPaths that returns a list of MosaicPath, and created list of RemoveUpdates out of them and passed them into updateTree.
Sometimes (not all the times) the updateTree fail because one of the remove updates causes the tree to rebalance, thus the remaining updates cannot proceed because the paths are no longer valid.
Perhaps one way to address it is to disallow rebalancing during the updateTree to ensure the paths it takes in continue to be valid, and then rebalance at the end if needed.