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

Cannot draw areas, leads to crash. Reproducible #5996

Closed
famo opened this issue Feb 28, 2019 · 7 comments
Closed

Cannot draw areas, leads to crash. Reproducible #5996

famo opened this issue Feb 28, 2019 · 7 comments
Assignees
Labels
bug A bug - let's fix this!
Milestone

Comments

@famo
Copy link

famo commented Feb 28, 2019

Since today I cannot draw areas anymore. It always leads to a crash.
I can place 3 points and on the fourth it is crashing - reproducible...

When I'm home I will post a screencast.

User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
@famo
Copy link
Author

famo commented Mar 1, 2019

When I try to create an area here: https://www.openstreetmap.org/#map=19/48.29083/11.57035
like this
crash
it is crashing every time.

@famo
Copy link
Author

famo commented Mar 5, 2019

Anyone?
This problem seems to be related to the highways. Can someone else confirm?

For me this crashes under Windows and Linux (both firefox tho).

@tastrax
Copy link
Contributor

tastrax commented Mar 5, 2019 via email

@famo
Copy link
Author

famo commented Mar 5, 2019

It crahes upon choosing the fourth point (see attached image), while still in drawing mode.
53635577-d82c2280-3c1d-11e9-8e9e-87e75e5b5ff1

@tastrax
Copy link
Contributor

tastrax commented Mar 5, 2019 via email

@famo
Copy link
Author

famo commented Mar 5, 2019

Ok – it doesn’t crash but it doesn’t like it when ‘snapping to the existing node’ on the highway. Is that what you are experiencing? I then need to reset the browser (and not save changes) to get back in to use the editor. Is that the same issue?

Yes, this is exactly the issue!
(By "crash" I meant that the iD editor is "crashing" - not the browser. Sorry, that wasn't formulated very clearly by me.)

Try without snapping to an existing node – does it then work.

Yes, then it works.

Looks like a bug of some sort.

My words...

@quincylvania quincylvania added the bug A bug - let's fix this! label Mar 5, 2019
@bhousel bhousel self-assigned this Mar 5, 2019
@bhousel bhousel closed this as completed in e216d5b Mar 6, 2019
@bhousel
Copy link
Member

bhousel commented Mar 6, 2019

I just fixed this! This was a fun bug.
Clicking on point 3 would change its parent way by adding a new vertex, then clicking on point 4 would crash. It only happens when you click on an empty spot along a way adjacent to a vertex with an intersection and then click on that intersection.

Root cause was this:
While drawing, we do some funny things to the graph - to pop off and replace temporary drawing objects with real ones. Every time the graph would change, it would dispatch a change event, which would trigger a redraw of some things. In this case, one of those things was the sidebar for point 4, which (because it was an intersection) redraw the restrictions editor, and because the graph was in a weird state, the restriction editor was not happy.

I solved it by adding some functions to iD.coreHistory to pause and resume the dispatching of change events. It's not the first time I've come across this issue, and we might use it other places in the code.

(I might get rid of coreHistory.overwrite, as it was created to solve pretty much the same problem - avoid dispatching an expensive change event through a pop/perform).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug - let's fix this!
Projects
None yet
Development

No branches or pull requests

4 participants