biodranik created an issue (openstreetmap/openstreetmap-website#6100)

### URL

https://osm.org/note/4801754

### How to reproduce the issue?

In some cases, e.g. when a client didn't receive a success response from the 
notes API (bad network, app killed by the system, etc.), it may try to recreate 
the same note again and again. That leads to unnecessary duplication on the 
server and an unnecessary burden for the community to clean up such duplicate 
notes.

Example: 
https://api.openstreetmap.org/api/0.6/notes?closed=-1&bbox=116.53912,40.41724,116.53914,40.41726

Is there a reason why the OSM notes API implementation doesn't check if exactly 
the same note (text) already exists at exactly the same location?

The proposal is to add a server-side check in the [Create Notes API 
call](https://wiki.openstreetmap.org/wiki/API_v0.6#Create_a_new_note:_POST_/api/0.6/notes),
 that compares the coordinates and text of a new note with already existing 
one. And if they are equal, the server doesn't create a new note, but:

Option 1:
- Returns HTTP 200 as if the note was created, with its `id`.

Option 2:
- Return HTTP 409 to indicate that the duplicate note wasn't created.

Context: Organic Maps tries to upload collected map edits in the background. 
Looks like the system often kills background service/communication right when 
HTTP requests are going on, which [leads to duplicate OSM 
notes](https://github.com/organicmaps/organicmaps/issues/2071).

### Screenshot(s) or anything else?

_No response_

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/6100
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/6...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to