<p></p>
<h3 dir="auto">Problem</h3>
<p dir="auto">Sometimes the code tries to reproduce the sequence of element modifications but the data to do this is not directly available.</p>
<p dir="auto">Changeset downloads rely primarily on timestamps, and then additionally sort by version, type etc and it's done differently in <a href="https://github.com/openstreetmap/openstreetmap-website/blob/0c4cbda662502f05646a4e82f5d8f639b9183059/app/controllers/api/changesets_controller.rb#L158">osm-website</a> and <a href="https://github.com/zerebubuth/openstreetmap-cgimap/blob/2fa2d702017ddd136555e3562f574ac91870e8bc/src/osmchange_responder.cpp#L32">cgimap</a>. This additional ordering may not be correct. For example, it makes sense to reverse ordering by type for deletions. Relying on the additional ordering becomes necessary if timestamps are truncated, and that may happen if the data is restored from a dump.</p>
<p dir="auto">Changeset webpages show lists elements. Those also reproduce the modification sequence in most of the cases but that happens as a side-effect of them not being sorted. This lack of sorting causes problems elsewhere and so does assuming that the elements are not sorted, see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2182873280" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4571" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/4571/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/4571">#4571</a>.</p>
<h3 dir="auto">Description</h3>
<p dir="auto">Is it feasible to do this thing?<br>
<a href="https://github.com/openstreetmap/openstreetmap-website/blob/0c4cbda662502f05646a4e82f5d8f639b9183059/app/controllers/api/changesets_controller.rb#L154-L157">https://github.com/openstreetmap/openstreetmap-website/blob/0c4cbda662502f05646a4e82f5d8f639b9183059/app/controllers/api/changesets_controller.rb#L154-L157</a></p>
<ol dir="auto">
<li>Create one sequence to serve three old element tables.</li>
<li>Start it at a large enough number.</li>
<li>Add a column to each old element table with a default value taken from this sequence. This should work with db clients that don't yet know about this column but insert elements.</li>
<li>Backfill the column according to <a href="https://github.com/zerebubuth/openstreetmap-cgimap/blob/2fa2d702017ddd136555e3562f574ac91870e8bc/src/osmchange_responder.cpp#L32">this order</a>. It's not necessarily correct, maybe update it later.</li>
<li>Use this global version column for ordering (old) elements inside changesets on osm website and in other places.</li>
</ol>
<h3 dir="auto">Screenshots</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/4660">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLWVWCLXEATNU2R2LDY4KIPHAVCNFSM6AAAAABF4VOFTSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZTCMJWG4YDOMY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNBMSKC4EHQTWUBRM3Y4KIPHA5CNFSM6AAAAABF4VOFTSWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHIJ7HIME.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/4660</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/4660",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/4660",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>