Repository navigation
Fix crash when splitting a loop way in a route with node members - #13185
Closed
rajanpanth wants to merge 3 commits into
Closed
rajanpanth wants to merge 3 commits into
rajanpanth wants to merge 3 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…te-non-way-members # Conflicts: # CHANGELOG.md
Collaborator
|
close per https://agentscan.tools/user/rajanpanth - classified as large volume account, looks like it submits LLM generated PRs without human review |
Collaborator
|
if it is a real bug: please attach before and after reproduction (screen capture, preferably in form of video) that demonstrates that bug is real and not just LLM hallucination |
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.
Splitting a closed way that a route relation enters and leaves at the same node (a "spoon" loop, e.g. a bus turning loop) throws when the member two places before or after it is not a way:
That is the usual shape of a public transport route, where stop and platform nodes are listed before the ways. With the
spoon1fixture fromtest/spec/actions/split.jsand the members['s', 'p', '~', '-', '~'](sandpare nodes),actionSplit('d', ['='])throws.disabled()doesn't block the split, so the operation is offered and then fails.Cause
In
splitWayMember, the "loops" branch looks one member further (members[i - 2]/members[i + 2]) and passes it toconnects(), which reads.nodes. The direct neighbours a few lines above are only compared whentype === 'way'; this branch had no such check.The same branch used
i > 2for the look-behind, somembers[0]was never looked at when the split way is the third member. In that case the two halves could be inserted in the wrong order: for['-', '~', '#', '~']where~and#both run fromatob, splitting#gave['-', '~', '#', '=', '~']with# = [a, y], which doesn't touchbwhere the preceding~ends. With one more member in front, the same data was ordered correctly.Changes
members[i ± 2]when it is a way, like the direct neighbours.i >= 2.Tests
Three cases added to the "splitting spoon routes" block: a stop node after the ways, stop and platform nodes before the ways, and the third-member case. All three fail on
develop(two with theTypeError, one with the wrong order) and pass with this change.npm run test:once(2305 tests) andtscpass locally.eslintis clean for the two changed files apart fromlinebreak-style, which is my Windows checkout.AI disclosure: this bug was found, and the fix and tests written, with Claude Code. The reproduction and the test results above come from running them locally against
develop.🤖 Generated with Claude Code