Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Correctly create copiedNodes map when keep_node_ids is false #55

Merged
merged 1 commit into from
Nov 10, 2020
Merged

[Bugfix] Correctly create copiedNodes map when keep_node_ids is false #55

merged 1 commit into from
Nov 10, 2020

Conversation

rlippolis
Copy link
Contributor

Commit 1c097ca introduced a bug when running the StoryCopy util with keep_node_ids set to false.

In the copyNodes(...) method the MutableLongLongMap copiedNodes is now initialized with a null value when stableNodeIds is false, but it should be the other way around (when using stable node IDs, i.e. keep_node_ids is true, there's no need to keep track of copied node IDs, but when NOT using stable node IDs, the map should be initialized to keep track of the mapping between old and new IDs).

Because the node IDs are not tracked correctly, the correct node IDs cannot be determined when creating the relationships later, resulting in the wrong relationships being created (in case the 'old' node IDs happen to coincidentally match with some new node), or no relationship being created at all (if the old node ID no longer maps to a node in the new graph).

This fix corrects this behaviour. I've also re-added the initialCapacity value of 10_000_000, which was there originally before the above mentioned commit.

@jexp
Copy link
Owner

jexp commented Nov 10, 2020

Sorry my bad. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants