neo4jrb / activegraph

An active model wrapper for the Neo4j Graph Database for Ruby.
http://neo4jrb.io
MIT License
1.4k stars 276 forks source link

`has_one` association allows creation of two association when done concurrently #1705

Closed mrhardikjoshi closed 6 months ago

mrhardikjoshi commented 7 months ago

When a node's has_one association is updated concurrently, it does not respect the one association limit and due to race condition it may result in wrong data. This is very low probable scenario. More details with the spec proving the bug is in below PR

Code example (inline, gist, or repo)

https://github.com/neo4jrb/activegraph/pull/1704

Runtime information:

neo4j gem version: master branch ruby: ruby 3.1.2p20