streetcomplete / StreetComplete

Easy to use OpenStreetMap editor for Android
https://streetcomplete.app
GNU General Public License v3.0
3.9k stars 357 forks source link

Stacktrace/failing to upload - Deleting nodes on a way #2369

Closed peternewman closed 3 years ago

peternewman commented 3 years ago

On 13/12/2020 18:26, Peter Newman wrote:

Describe how to reproduce it here:

Again

de.westnordost.osmapi.common.errors.OsmApiException: Precondition Failed (412) - Precondition failed: Node 4243601447 is still used by ways 135119002,425013561,425013615. at de.westnordost.osmapi.OsmApiErrorFactory.createGenericError(OsmApiErrorFactory.java:49) at de.westnordost.osmapi.OsmApiErrorFactory.createError(OsmApiErrorFactory.java:40) at de.westnordost.osmapi.OsmConnection.handleResponseCode(OsmConnection.java:349) at de.westnordost.osmapi.OsmConnection.makeRequest(OsmConnection.java:195) at de.westnordost.osmapi.OsmConnection.makeAuthenticatedRequest(OsmConnection.java:161) at de.westnordost.osmapi.map.MapDataDao.uploadChanges(MapDataDao.java:121) at de.westnordost.streetcomplete.data.osm.delete_element.DeleteSingleOsmElementUploader.upload(DeleteSingleOsmElementUploader.kt:16) at de.westnordost.streetcomplete.data.osm.delete_element.DeleteOsmElementsUploader.uploadSingle(DeleteOsmElementsUploader.kt:29) at de.westnordost.streetcomplete.data.osm.delete_element.DeleteOsmElementsUploader.uploadSingle(DeleteOsmElementsUploader.kt:13) at de.westnordost.streetcomplete.data.osm.upload.OsmInChangesetsUploader.uploadSingle(OsmInChangesetsUploader.kt:61) at de.westnordost.streetcomplete.data.osm.upload.OsmInChangesetsUploader.upload(OsmInChangesetsUploader.kt:32) at de.westnordost.streetcomplete.data.osm.delete_element.DeleteOsmElementsUploader.upload(DeleteOsmElementsUploader.kt:23) at de.westnordost.streetcomplete.data.upload.UploadService.onHandleIntent(UploadService.kt:90) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:76) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:280) at android.os.HandlerThread.run(HandlerThread.java:65)

How to Reproduce I wasn't entirely sure which change had upset it initially, but it kept failing to upload even after a force quit. @westnordost got to the bottom of it.

What's really odd is it failed at least ten times, but later on it had seemingly succeeded and later edits have gone through. Although the node is still there, so did it just give up on that specific quest answer after a certain number of attempts?

Versions affected v28.0-beta1

Initial response from @westnordost

Hm.

https://www.openstreetmap.org/node/4243601447 can't be deleted because it is a vertex of the said ways. Question is what StreetComplete should do in that case. I think this should be discussed on the issue tracker.

peternewman commented 3 years ago

Question is what StreetComplete should do in that case. I think this should be discussed on the issue tracker.

For the case of ATMs, I'd suggest just removing the keys from the node, the way will then retain it's correct shape. Although I guess the question there is which keys, obviously at least what it searched for (so amenity=atm) but I don't know how it reliably tells which other keys are related to this attribute and not something else...

Or it could just leave a note...

matkoniecz commented 3 years ago

https://www.openstreetmap.org/node/4243601447 can't be deleted because it is a vertex of the said ways. Question is what StreetComplete should do in that case. I think this should be discussed on the issue tracker.

If deletion was attempted then removing tags would be reasonable. In theory it could be tagged as both ATM and something else, but I cannot imagine situation where it happens - so tag blanking may be safe to do.

westnordost commented 3 years ago

So in this case, the uploader will instead of deleting the vertex, clear all the tags.

If any of the tags have been changed in the meantime, the uploader will throw a conflict exception which leads to silently dropping the user's answer as usual for StreetComplete auto-conflict-resolution.

peternewman commented 3 years ago

If deletion was attempted then removing tags would be reasonable. In theory it could be tagged as both ATM and something else, but I cannot imagine situation where it happens - so tag blanking may be safe to do.

The only one I can come up with from the current list is something like amenity=telephone/advertising=? or likewise with amenity=atm. I guess there's a small chance they'd remove a combined unit and replace it with just an advertising board, but probably rather unlikely.

If any of the tags have been changed in the meantime, the uploader will throw a conflict exception which leads to silently dropping the user's answer as usual for StreetComplete auto-conflict-resolution.

Ah, so that was why it eventually sorted itself out then?