1
0
Fork 0
forked from fedi/mastodon
mastodon/app
Claire 02a87431cf
Fix error when suspending user with an already-existing canonical email block (#17036)
* Fix error when suspending user with an already-existing canonical email block

Fixes #17033

While attempting to create a `CanonicalEmailBlock` with an existing hash would
raise an `ActiveRecord::RecordNotUnique` error, this being done within a
transaction would cancel the whole transaction. For this reason, checking for
uniqueness in Rails would query the database within the transaction and avoid
invalidating the whole transaction for this reason.

A race condition is still possible, where multiple accounts sharing a canonical
email would be blocked in concurrent transactions, in which only one would
succeed, but that is way less likely to happen that the current issue, and can
always be retried after the first failure, unlike the current situation.

* Add tests
2021-11-24 17:41:03 +01:00
..
chewy Bump chewy from 5.2.0 to 7.2.3 (supports Elasticsearch 7.x) (#16915) 2021-11-18 22:02:08 +01:00
controllers Fix reviving revoked sessions and invalidating login (#16943) 2021-11-06 00:13:58 +01:00
helpers Add Northern Kurdish locale as requested by translator. It already has a project started on Crowdin. (#16548) 2021-10-14 21:02:54 +02:00
javascript Fix overflow of long profile fields in admin view (#17010) 2021-11-19 18:22:49 +01:00
lib Fix confusing error when webfinger request returns empty document (#16986) 2021-11-14 21:55:40 +01:00
mailers Prepare Mastodon for Rails 6 (#15911) 2021-03-17 10:09:55 +01:00
models Fix error when suspending user with an already-existing canonical email block (#17036) 2021-11-24 17:41:03 +01:00
policies Add ability to skip sign-in token authentication for specific users (#16427) 2021-07-08 05:31:28 +02:00
presenters Add graphs and retention metrics to admin dashboard (#16829) 2021-10-14 20:44:59 +02:00
serializers Add graphs and retention metrics to admin dashboard (#16829) 2021-10-14 20:44:59 +02:00
services Bump chewy from 5.2.0 to 7.2.3 (supports Elasticsearch 7.x) (#16915) 2021-11-18 22:02:08 +01:00
validators Minor memory optimizations (#16507) 2021-10-14 21:04:57 +02:00
views Add graphs and retention metrics to admin dashboard (#16829) 2021-10-14 20:44:59 +02:00
workers Fix AccountNote not having a maximum length (#16942) 2021-11-06 00:12:25 +01:00