<p></p>
<p><b>@gravitystorm</b> approved this pull request.</p>
<p dir="auto">This looks good to me, but I defer to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tomhughes/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tomhughes">@tomhughes</a> since he has more database expertise. He mentioned in the original issue that a transaction should be enough, but I don't think it's the case and I agree with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mmd-osm/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mmd-osm">@mmd-osm</a> that a lock is necessary. Otherwise two transactions could run in parallel, both read the original status, be happy, and each add a comment without causing either transaction to fail.</p>
<p dir="auto">I've checked the rails documentation and code, to make sure that the transaction will be rolled back (and therefore the lock released) if we raise errors ourselves.</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/5053#pullrequestreview-2225485808">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLNYGVYPU7XEHWPMVSLZQIZ7HAVCNFSM6AAAAABMC4YHKSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDEMRVGQ4DKOBQHA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLJ7Z7X3YCK544RXAUDZQIZ7HA5CNFSM6AAAAABMC4YHKSWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTUEUY37A.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/5053/review/2225485808</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/5053#pullrequestreview-2225485808",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5053#pullrequestreview-2225485808",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>