<div style="display: flex; flex-wrap: wrap; white-space: pre-wrap; align-items: center; "><img height="20" width="20" style="border-radius:50%; margin-right: 4px;" decoding="async" src="https://avatars.githubusercontent.com/u/170263?s=20&v=4" /><strong>biodranik</strong> created an issue <a href="https://github.com/openstreetmap/openstreetmap-website/issues/6100">(openstreetmap/openstreetmap-website#6100)</a></div>
<h3 dir="auto">URL</h3>
<p dir="auto"><a href="https://osm.org/note/4801754" rel="nofollow">https://osm.org/note/4801754</a></p>
<h3 dir="auto">How to reproduce the issue?</h3>
<p dir="auto">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.</p>
<p dir="auto">Example: <a href="https://api.openstreetmap.org/api/0.6/notes?closed=-1&bbox=116.53912,40.41724,116.53914,40.41726" rel="nofollow">https://api.openstreetmap.org/api/0.6/notes?closed=-1&bbox=116.53912,40.41724,116.53914,40.41726</a></p>
<p dir="auto">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?</p>
<p dir="auto">The proposal is to add a server-side check in the <a href="https://wiki.openstreetmap.org/wiki/API_v0.6#Create_a_new_note:_POST_/api/0.6/notes" rel="nofollow">Create Notes API call</a>, 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:</p>
<p dir="auto">Option 1:</p>
<ul dir="auto">
<li>Returns HTTP 200 as if the note was created, with its <code class="notranslate">id</code>.</li>
</ul>
<p dir="auto">Option 2:</p>
<ul dir="auto">
<li>Return HTTP 409 to indicate that the duplicate note wasn't created.</li>
</ul>
<p dir="auto">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 <a href="https://github.com/organicmaps/organicmaps/issues/2071" data-hovercard-type="issue" data-hovercard-url="/organicmaps/organicmaps/issues/2071/hovercard">leads to duplicate OSM notes</a>.</p>
<h3 dir="auto">Screenshot(s) or anything else?</h3>
<p dir="auto"><em>No response</em></p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/6100">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLI57NNPLEHTSTIRJP33DPR7LAVCNFSM6AAAAAB7JZRYEKVHI2DSMVQWIX3LMV43ASLTON2WKOZTGE2DKOBWGE3DKNI">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOS6URK5IOGSAXHNYD3DPR7LA5CNFSM6AAAAAB7JZRYEKWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHLXAQKC4.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/6100</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/6100",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/6100",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>