nohm
nohm copied to clipboard
.remove() on instance that has old values doesn't delete everything
When an instance is removed, it only removes indices/uniquelocks for the values that have been loaded into that instance.
A static .remove() (aka with an unloaded instance or on the static class) does a load immediately before removing and thus rarely runs into this issue, but it still isn't atomic.
Instead a more thorough live search of ids in all indices has to be performed. This is costly, so it would also be a good target for future improvements by making it a lua script.
Another more "atomic" way would be to create a lock immediately on remove and then do a more costly SCAN iteratively.
Also possibly removing the on-instance .remove() in favor of always using a static one that requires an id attribute.