Handling failed uploads properly
Objavil SimonPoole v 26 februar 2025 v jeziku English. Nazadnje posodobljeno 18 julij 2025.Some of the readers may have experienced the sinking feeling when they just attempted to upload dozens if not 100s of changes and a network glitch resulted in the editor app failing the upload.
What’s the problem when that happens?
It is literally that your editing app doesn’t know if any new objects it created locally have been successfully created on the server or not. If they have been created, retrying the upload will create duplicates, and if you don’t retry you potentially loose your work.
This post is related to work that I’m doing for version 21 of Vespucci that automates all of this, but the interesting thing is that you can easily handle many of the cases manually without editor support.
As you may know OSM changesets are not atomic, but individual uploads are (yes, you can upload multiple times in to the same changeset). With other words if your upload succeeded, but your editing app lost the response from the server, all your changes will have been successfully made, and, the other way around, if your upload fails it will fail completely.
The other point to note is that changesets are opened in a separate operation and are only automatically closed after a timeout of an hour if they are not explicitly closed after the upload by your editing app.
A normal upload operation will roughly contain the following steps
- open the changeset.
- upload the data and process the response. Depending on your editing app it will update the downloaded data in place, or throw it away and re-download from the server.
- close the changeset.
This means that there are simple cases that you can handle manually, assuming you are not uploading more than once per changeset (more on that later):