<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/360803?s=20&v=4" /><strong>gravitystorm</strong> left a comment <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6361#issuecomment-3382347461">(openstreetmap/openstreetmap-website#6361)</a></div>
<p dir="auto">So as I understand it, these counter discrepancies were (and still are, see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3384785277" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/6379" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/6379/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/6379">#6379</a>) coming from race conditions when handling changesets, which we are fixing separately.</p>
<p dir="auto">I'm not super keen on huge SQL queries being run in production, without any unit tests! But at least this is only affecting the counter attributes, so the data can be recreated if something goes wrong. And given I'm not running it in production myself, then technically it's not my responsibility!</p>
<p dir="auto">In future, I would be more comfortable with the queries and/or associated code being elsewhere (e.g. in a file in <code class="notranslate">lib/</code>) where it can be more easily tested (even just to catch syntax errors, or document expected behaviour) and the rake task just being a one-liner to call that code.</p>
<p dir="auto">I'm going to merge this, but I haven't actually run it myself or verified that it correctly fixes incorrect <code class="notranslate">num_changes</code>, so caveat emptor!</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/6361#issuecomment-3382347461">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLIJ6LXK6F356ZZRWPT3WU34NAVCNFSM6AAAAACE7APO7SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGOBSGM2DONBWGE">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLN3PWLE6EJB2GBRRFD3WU34NA5CNFSM6AAAAACE7APO7SWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTWJTKDMK.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/6361/c3382347461</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/6361#issuecomment-3382347461",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/6361#issuecomment-3382347461",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>