Open yourpalal opened 3 years ago
@yourpalal do you currently have overlapping ids between models? I know that requiring global uniqueness is unnecessarily strong, but it is best practice. What id generator are you using?
We do have some overlapping ids between models. We import various external datasets and use the IDs used in those datasets as id_properties. Often, one data set will have several data types, which then become different models in activegraph.
In some cases, there is overlap of IDs within a single dataset, and in others there is overlap between these datasets.
Many datasets we import use integer ids (probably AUTOINT in their database) which can increase the likelihood of overlap between datasets.
Generally, any non-uuid ID property could end up running into this issue. If universally-unique IDs are required by ActiveGraph, that would be pretty easy to achieve by always using a uuid property, but I don't believe this is stated anywhere in the documentation.
While investigating #1652, I noticed that QueryProxy replace_with compares IDs for all models to determine which relationships to delete and insert.
Assuming the id in question is a
uuid
, this probably works out fine, but when using multiple model classes, there could be some overlap of ids between the two model classes.Note: the problem in the example below is currently hidden by the bug reported in #1652 . If
pluck(:id)
is were fixed, but no other changes were applied, then #1652 could be considered fixed, while this issue would not be.Probably the best course of action is to fix this and #1652 at the same time.
Code example (inline, gist, or repo)
Runtime information:
Neo4j database version: neo4j gem version: 10.1.0 neo4j-ruby-driver gem version: 1.7.5