maritz / nohm

node.js object relations mapper (orm) for redis
http://maritz.github.io/nohm/
MIT License
500 stars 64 forks source link

prefix.relationKeys set is not handled correctly on unlink which then breaks unlinkAll #183

Open maritz opened 2 years ago

maritz commented 2 years ago

The set of prefix.relationKeys (where keys are stored under which the actual relations then are) is currently not handled properly on an unlink. It removes the entire thing.

Instead it should probably remove the ids from the prefix.relations set as it is now, then in an asynchronous check afterwards conditionally remove the prefix.relationKeys set, if the prefix.relations set is empty/gone.