facebook / Rapid

The OpenStreetMap editor driven by open data, AI, and supercharged features
https://rapideditor.org
ISC License
517 stars 91 forks source link

Moving a way attached to two intersections causes an exception #524

Closed Bonkles closed 1 year ago

Bonkles commented 2 years ago

Description

While moving w550552269 around, I received an 'Uncaught Typeerror'.

Pic: image

Stack trace here, but don't believe its lies (chrome 103 has issues with stack traces lining up incorrectly)

multipolygon.js:16 Uncaught TypeError: Cannot read properties of undefined (reading '_proj')
    at project (multipolygon.js:16:14)
    at Array.map (<anonymous>)
    at replaceMovedVertex (_baseTrim.js:178:60)
    at cleanupIntersections (_baseTrim.js:296:21)
    at Array.action (_baseTrim.js:356:21)
    at _act (AbstractMode.js:43:29)
    at _perform (AbstractMode.js:61:28)
    at Object.perform (AbstractMode.js:185:24)
    at iD.js:109540:27
    at doMove (section.js:68:9)

Version

2.0-alpha

What browser are you seeing the problem on? What version are you running?

Chrome v103.0

Steps to reproduce

Select a way that bridges two intersections (say, in an urban area). The way I used is w550552269.

Hit 'm' to move. You should see the stack trace happen immediately as soon as you move the mouse.

The browser URL at the time you encountered the bug

http://127.0.0.1:8080/#background=Maxar-Premium&datasets=fbRoads,msBuildings&disable_features=boundaries&id=w550552269&map=20.00/47.60635/-122.33682

Bonkles commented 2 years ago

Addendum: Here's the stack trace I get from Edge:

/Users/clarkben/working/RapiD/node_modules/@pixi/utils/src/browser/hello.ts:45
Uncaught TypeError TypeError: Cannot read properties of undefined (reading '_proj')
    at project (/Users/clarkben/working/RapiD/node_modules/@id-sdk/projection/built/projection.mjs:16:14)
    at replaceMovedVertex (/Users/clarkben/working/RapiD/modules/actions/move.js:178:60)
    at cleanupIntersections (/Users/clarkben/working/RapiD/modules/actions/move.js:296:21)
    at action (/Users/clarkben/working/RapiD/modules/actions/move.js:356:21)
    at _act (/Users/clarkben/working/RapiD/modules/core/history.js:43:29)
    at _overwrite (/Users/clarkben/working/RapiD/modules/core/history.js:86:28)
    at overwrite (/Users/clarkben/working/RapiD/modules/core/history.js:199:20)
    at <anonymous> (/Users/clarkben/working/RapiD/modules/core/context.js:309:25)
    at doMove (/Users/clarkben/working/RapiD/modules/modes/move.js:68:9)
    at move (/Users/clarkben/working/RapiD/modules/modes/move.js:91:9)
    at <anonymous> (/Users/clarkben/working/RapiD/node_modules/d3-selection/src/selection/on.js:3:14)
Bonkles commented 1 year ago

This bug seems to be a thing of the past. The worst that happens is the nodes for the intersections don't get repainted adequately.