Preserve Rapid accept self-merge endpoints#1814
Open
bos wants to merge 1 commit into
Open
Conversation
Fixes facebook#1813. When accepting connected Rapid/Overture roads, endpoint auto-connect can select the endpoint node itself as the best merge target. The node is not an orphaned duplicate in that case; removing it leaves a previously accepted connected way with a missing child node. Skip duplicate-node replacement/removal when the merge target is the endpoint itself, while preserving the existing behavior for true duplicate endpoint merges. The bug was introduced in PR facebook#1769 by commit 9a2e029 ("Auto connect new ways, inherit classification"), which added the endpoint auto-connect merge path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1813.
When accepting connected Rapid/Overture roads, endpoint auto-connect can select the endpoint node itself as the best merge target. In that self-merge case the node is already the shared endpoint between accepted ways, not an orphaned duplicate.
This PR skips duplicate-node replacement/removal when
bestResult.mergeNodeId === node.id, while keeping the existing behavior for true duplicate endpoint merges.Root Cause
The bug was introduced in #1769 by commit
9a2e029087de9903291e9b20431cbcc75c611008(Auto connect new ways, inherit classification). That commit added the endpoint auto-connect merge path and unconditionally removed the endpoint node after replacing accepted-way references withbestResult.mergeNodeId.If the merge target is the endpoint itself, that replacement is a no-op and the subsequent removal deletes the shared node out from under previously accepted connected ways.
Testing
./node_modules/.bin/dotenvx run --quiet -- node --experimental-test-coverage --test-reporter spec --test test/unit/actions/rapid_accept_feature.test.js