mastodon/app
Claire 3c18311d86 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-26 01:22:10 +01:00
..
chewy
controllers Fix login being broken due to inaccurately applied backport fix in 3.4.2 2021-11-06 05:17:39 +01:00
helpers Change number_to_human calls to always use 3-digits precision (#16469) 2021-11-05 23:46:24 +01:00
javascript Fix overflow of long profile fields in admin view (#17010) 2021-11-26 01:21:57 +01:00
lib Fix confusing error when webfinger request returns empty document (#16986) 2021-11-26 01:21:50 +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-26 01:22:10 +01:00
policies Add management of delivery availability in Federation settings (#15771) 2021-05-05 23:39:02 +02:00
presenters
serializers Add `configuration` attribute to `GET /api/v1/instance` (#16485) 2021-11-05 20:30:02 +01:00
services Fix some link previews being incorrectly generated from other prior links (#16885) 2021-11-05 20:28:59 +01:00
validators Add `configuration` attribute to `GET /api/v1/instance` (#16485) 2021-11-05 20:30:02 +01:00
views Change number_to_human calls to always use 3-digits precision (#16469) 2021-11-05 23:46:24 +01:00
workers Fix AccountNote not having a maximum length (#16942) 2021-11-06 00:17:05 +01:00