<p dir="auto">To find out which element order makes sense for <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>, I looked at how elements are sorted in changeset downloads. They are sorted by timestamp, then by version. Then I decided to simplify the code by replacing <code class="notranslate">sort</code>+ifs with <code class="notranslate">sort_by</code>, and I noticed that there are no tests for sort order.</p>
<p dir="auto">Cgimap actually sorts further by type and id too: <a href="https://github.com/zerebubuth/openstreetmap-cgimap/blob/ea3e59543116fa97fd68e6d97813b1ee46e54290/src/osmchange_responder.cpp#L32">https://github.com/zerebubuth/openstreetmap-cgimap/blob/ea3e59543116fa97fd68e6d97813b1ee46e54290/src/osmchange_responder.cpp#L32</a>. With <code class="notranslate">sort_by</code> it's easy to add this to osm-website if required.</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/4612'>https://github.com/openstreetmap/openstreetmap-website/pull/4612</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4612/commits/9c0d74fe690b76b1d307c3764532f4f89c7192dd" class="commit-link">9c0d74f</a> Simplify and test downloaded changeset element sorting</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4612/files">2 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4612/files#diff-6726f8601cd22886963fb41888b55956cae4f8124aa12c701da77c3add44d94c">app/controllers/api/changesets_controller.rb</a>
(8)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4612/files#diff-e95198c7f7744be3ce9857db36d2374538ca7d64caaf0f6f85865d6752563ee9">test/controllers/api/changesets_controller_test.rb</a>
(34)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4612.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/4612.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4612.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/4612.diff</a></li>
</ul>
<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/pull/4612">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLBPR7IQLQBMBSP2NDYZMH7HAVCNFSM6AAAAABFB3SFBOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYDANZTGY2DCOI">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLIPP4SIXHRJU3XHZLDYZMH7HA5CNFSM6AAAAABFB3SFBOWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHIGLESUM.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/pull/4612</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/pull/4612",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4612",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>