[openstreetmap/openstreetmap-website] Validation for note transitions (Issue #4528)

mmd notifications at github.com
Tue Jul 16 17:05:39 UTC 2024


Try to add a "sleep 10" right before `@note.close` and then test in two different browser windows. Without explicit locking you can resolve the note twice, with locking in place the second resolve attempt fails with an error message "The note xxx was closed at yyy UTC".

It would probably be better to use optimistic locking in this case, since conflicts should be extremely rare. On the other hand, our Note model doesn't have a lock_version field, which is needed according to https://api.rubyonrails.org/classes/ActiveRecord/Locking/Optimistic.html

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/4528#issuecomment-2231414812
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/4528/2231414812 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240716/340a69d0/attachment-0001.htm>


More information about the rails-dev mailing list