-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
more gracefully handle incomplete uploads #9540
Comments
Could iD provide a checksum on the proposed edits, then compare that checksum again once the upload is completed? If the checksum isn't confirmed, could iD then revert the initial attempt to update OSM, then try again fully in a fresh changeset?
|
iD knows the ID of the changeset it last tried to upload. It can fetch that upload and if changes_count is zero then it knows to upload again, otherwise the upload succeeded and it can clear the modified objects. |
Thanks @bhousel for the additional background.
As far as I can tell, this is still how it works (modulo some small changes like the switch to oauth2). From what I can see, your fix did unfortunately never reliably/completely fix the issue: I was able to reproduce the bug also in iD version 2.11 (which was the first one to have the fix from 930e865) using the same steps mentioned above, resulting in https://api06.dev.openstreetmap.org/node/4332777649 and https://api06.dev.openstreetmap.org/node/4332777650 🤷 Also, from what I can see, the logic in your fix seems to be I think we need to replace this with a more robust solution. I really like the approach outlined by @bryceco 👍 |
No, you're not overlooking anything - that is the intent. I guess if we wanted to be more conservative, we could relocate the history to a different localstorage key temporarily and delete it for good once the changeset is known to be uploaded, or relocate it back if we detect an API error. (Honestly we should not even be using localStorage for this anymore - serializing the history is slow and we regularly hit the size limit of what we can store in there). The thing we are really trying to account for is the situation where a user hits the upload button and then immediately Ctrl-W closes the tab, and opens a new one to keep editing as fast as possible. Once the tab is unloaded, our code is gone and there's nothing we can do about it - this is why the history needs to go away ASAP, and it doesn't make much sense trying to cleverly handle slow connections and API failures. |
@tyrasd There is a longish discussion on this very topic here openstreetmap/openstreetmap-website#2201 Short version while it definitely can be made more robust, fixing it completely would require an API add on. Not a reason not to do what is possible now, but at least I have been a bit wary of this, because the situation in which it occurs (aka flaky networks) will potentially make the fix flaky too. PS: as iD doesn't do chunk uploads the situation is slightly simpler than for JOSM and Vespucci. |
When an upload is aborted mid-way (e.g. by closing the browser tab or because of a network connection issue), iD will ask to restore data in the next mapping session. This can then lead to duplicates, like in this example: object (first changeset), duplicate (second changeset)
Steps to reproduce:
These are actions to mitigate this:
The text was updated successfully, but these errors were encountered: