Fix scheduled statuses decreasing statuses counts (#16791)

* Add tests

* Fix scheduled statuses decreasing statuses counts

Fixes #16774
This commit is contained in:
Claire
2021-10-14 19:59:21 +02:00
committed by GitHub
parent 5159ba26e4
commit 216570ad98
3 changed files with 27 additions and 20 deletions

View File

@ -74,6 +74,9 @@ class PostStatusService < BaseService
status_for_validation = @account.statuses.build(status_attributes)
if status_for_validation.valid?
# Marking the status as destroyed is necessary to prevent the status from being
# persisted when the associated media attachments get updated when creating the
# scheduled status.
status_for_validation.destroy
# The following transaction block is needed to wrap the UPDATEs to