<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/36066?s=20&v=4" /><strong>pablobm</strong> left a comment <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6564#issuecomment-3626490342">(openstreetmap/openstreetmap-website#6564)</a></div>
<p dir="auto">There's a problem with allowing <code class="notranslate">confirmed</code> users to transition to <code class="notranslate">suspended</code>.</p>
<p dir="auto">Currently, there's an <code class="notranslate">User.after_save :spam_check</code>. This in turn looks like follows:</p>
<p dir="auto"><a href="https://github.com/openstreetmap/openstreetmap-website/blob/398660d1fa0007c9a0e65d26fb6b4a8e4a422da8/app/models/user.rb#L404-L406">https://github.com/openstreetmap/openstreetmap-website/blob/398660d1fa0007c9a0e65d26fb6b4a8e4a422da8/app/models/user.rb#L404-L406</a></p>
<p dir="auto">So we enter this problem:</p>
<ol dir="auto">
<li>A legit user is suspended automatically by the spam check (a false positive).</li>
<li>An admin confirms the user to reactivate them and protect them from future spam checks.</li>
<li>As the user is confirmed, they are saved... and immediately suspended again as the spam check returns a new false positive.</li>
</ol>
<p dir="auto">Ways around this issue:</p>
<ol dir="auto">
<li>We add an additional <code class="notranslate">&& !confirmed?</code> to the spam check condition, so that it specifically doesn't trigger on confirmed users. They can still be suspended/unconfirmed manually.</li>
<li>We return to disallowing the transition <code class="notranslate">confirmed -> suspended</code>.</li>
<li>We change the logic completely.</li>
<li>Other?</li>
</ol>
<p dir="auto">I'm going to go for option 1, but please let me know if you think differently.</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/6564#issuecomment-3626490342">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPSTAFTPAIUVK5RW5T4AVPVRAVCNFSM6AAAAACNE3XLA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMMRWGQ4TAMZUGI">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPINKULMMHGANWVHP34AVPVRA5CNFSM6AAAAACNE3XLA6WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTWYE7M6M.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/6564/c3626490342</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/6564#issuecomment-3626490342",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/6564#issuecomment-3626490342",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>