<span style="color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;">
<blockquote>
<p dir="auto">If we set an updated_at attribute whenever a new version is created, why would sorting by that be problematic? Wouldn't it be sufficient for ordering by the latest updates instead of relying on a surrogate id from note_comments?</p>
</blockquote>
<p dir="auto">That's what I tried to do in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2150369576" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4532" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/4532/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/4532">#4532</a>. In our pagination code we have <code class="notranslate">before</code> and <code class="notranslate">after</code> parameters that are ids which works fine when we order by ids. Ordering by ids is like ordering by creation date. If we want to order by update date but still have ids in <code class="notranslate">before</code> and <code class="notranslate">after</code>, see that pull request for what I had to do.</p>
<p dir="auto">Another option is to use timestamps in <code class="notranslate">before</code>/<code class="notranslate">after</code> instead of ids, but then we'd have to decide on precision. Our standard precision of 1 second that we use in the api responses is not enough, you can get two notes updated in the same second easily. And there's no guarantee that they won't get the same update time.</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/pull/5815#issuecomment-2752695486">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLWKLIAV7UKSLUUJKT2WHKUVAVCNFSM6AAAAABZFBY7WSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJSGY4TKNBYGY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLKZY4KTDEH4KUDDLAD2WHKUVA5CNFSM6AAAAABZFBY7WSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTVECLGL4.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/5815/c2752695486</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
</span>
<div style="display: flex; flex-wrap: wrap; white-space: pre-wrap; align-items: center; "><img alt="AntonKhorev" height="20" width="20" style="border-radius:50%; margin-right: 4px;" decoding="async" src="https://avatars.githubusercontent.com/u/4158490?s=20&v=4" /><strong>AntonKhorev</strong> left a comment <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5815#issuecomment-2752695486">(openstreetmap/openstreetmap-website#5815)</a></div>
<blockquote>
<p dir="auto">If we set an updated_at attribute whenever a new version is created, why would sorting by that be problematic? Wouldn't it be sufficient for ordering by the latest updates instead of relying on a surrogate id from note_comments?</p>
</blockquote>
<p dir="auto">That's what I tried to do in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2150369576" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4532" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/4532/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/4532">#4532</a>. In our pagination code we have <code class="notranslate">before</code> and <code class="notranslate">after</code> parameters that are ids which works fine when we order by ids. Ordering by ids is like ordering by creation date. If we want to order by update date but still have ids in <code class="notranslate">before</code> and <code class="notranslate">after</code>, see that pull request for what I had to do.</p>
<p dir="auto">Another option is to use timestamps in <code class="notranslate">before</code>/<code class="notranslate">after</code> instead of ids, but then we'd have to decide on precision. Our standard precision of 1 second that we use in the api responses is not enough, you can get two notes updated in the same second easily. And there's no guarantee that they won't get the same update time.</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/pull/5815#issuecomment-2752695486">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLWKLIAV7UKSLUUJKT2WHKUVAVCNFSM6AAAAABZFBY7WSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONJSGY4TKNBYGY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLKZY4KTDEH4KUDDLAD2WHKUVA5CNFSM6AAAAABZFBY7WSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTVECLGL4.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/5815/c2752695486</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/5815#issuecomment-2752695486",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5815#issuecomment-2752695486",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>