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

Handle removal from the DOM when integrated in React apps #8090

Closed
willemarcel opened this issue Oct 16, 2020 · 5 comments
Closed

Handle removal from the DOM when integrated in React apps #8090

willemarcel opened this issue Oct 16, 2020 · 5 comments
Labels
bug A bug - let's fix this! chore-embed Improvements to the embedded iD workflow

Comments

@willemarcel
Copy link
Contributor

We are having some problems when running iD inside Tasking Manager.

What I noticed is that if I have a task open on iD in TM, then I move to another React view and go back (both using the back button or selecting to resume the task), iD will load but won't download the data again. It's working like if we didn't restart iD, but just went back to the instance that were running (although the OSM data is not rendered). Users reported also that if they try to load a neighbour task, iD doesn't download data.

Maybe a solution is to add a destroy action on iD that would remove it from the DOM, like it's explained on: https://reactjs.org/docs/integrating-with-other-libraries.html#integrating-with-dom-manipulation-plugins

@quincylvania
Copy link
Collaborator

@willemarcel Thanks for opening this, it's a big bug! I wouldn't be surprised if iD isn't caching/uncaching things properly since it hasn't historically been restarted like this, but we'll need to look further into it.

@quincylvania quincylvania added bug-release-blocker An important bug - let's get this fixed in the next release! chore-embed Improvements to the embedded iD workflow labels Oct 16, 2020
@quincylvania quincylvania added this to the 2.19.0 milestone Oct 16, 2020
@quincylvania quincylvania self-assigned this Oct 26, 2020
@quincylvania quincylvania added bug A bug - let's fix this! and removed bug-release-blocker An important bug - let's get this fixed in the next release! labels Oct 27, 2020
@quincylvania quincylvania removed this from the 2.19.0 milestone Oct 27, 2020
@jayenashar
Copy link

not sure if it helps, but i've got a related report from a user (@tastrax) of the oceania tasking manager. he gave me this stack trace. i checked the network traffic and it looks ok (i.e. nodes before ways from OSM's API).

iD.min.js:1 Uncaught Error: entity n7921680851 not found
    at coreGraph.entity (iD.min.js:1)
    at coreGraph.childNodes (iD.min.js:1)
    at osmWay.<anonymous> (iD.min.js:1)
    at coreGraph.transient (iD.min.js:1)
    at osmWay.asGeoJSON (iD.min.js:1)
    at r (iD.min.js:1)
    at Array.filter (<anonymous>)
    at iD.min.js:1
    at Selection.selection_call [as call] (iD.min.js:1)
    at iD.min.js:1

@willemarcel
Copy link
Contributor Author

@jayenashar I'm solving it with hotosm/tasking-manager#3792

@jayenashar
Copy link

fantastic. i'll pull it into our TM so @tastrax can use it

@quincylvania
Copy link
Collaborator

@jayenashar I'm solving it with hotosm/tasking-manager#3792

🕺

@quincylvania quincylvania removed their assignment Oct 29, 2020
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! chore-embed Improvements to the embedded iD workflow
Projects
None yet
Development

No branches or pull requests

3 participants