Skip to content

Preserve Rapid accept self-merge endpoints#1814

Open
bos wants to merge 1 commit into
facebook:mainfrom
bos:fix-rapid-accept-self-merge-endpoint
Open

Preserve Rapid accept self-merge endpoints#1814
bos wants to merge 1 commit into
facebook:mainfrom
bos:fix-rapid-accept-self-merge-endpoint

Conversation

@bos

@bos bos commented Jun 12, 2026

Copy link
Copy Markdown

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 with bestResult.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

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.
@meta-cla meta-cla Bot added the cla signed label Jun 12, 2026
@bos bos marked this pull request as ready for review June 13, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accepting connected Rapid roads can delete their shared endpoint

1 participant