Процесс возникновения проблемы:
Удаление поста
За 5 минут до истечения срока — немедленное постоянное удаление только что созданного поста
Появление обычного уведомления о необходимости ожидания 5 минут
После автоматического возврата возникает проблема: удалённый пост автоматически восстанавливается в состояние «не удалён». Требуется снова удалить его и затем заново подождать 5 минут для постоянного удаления.
1 лайк
Спасибо за отчет Это будет исправлено в
main ← fix/permanently-delete-undoes-soft-delete
merged 06:35PM - 23 Mar 26 UTC
When an admin soft-deletes a post then tries to permanently delete it before the… 5-minute timer expires, the server correctly returns a 403. However, the client-side error handler calls `undoDeleteState()` which clears `deleted_at` and restores the post to a non-deleted state in the UI — even though it remains deleted on the server. The admin then has to delete it again and wait another 5 minutes.
This happens because `destroy()` always calls `setDeletedState()` before the AJAX request, overwriting `oldCooked` even when the post is already deleted. When the request fails, `undoDeleteState()` uses that stale `oldCooked` to revert the post to a non-deleted state.
The fix skips `setDeletedState()` in `destroy()` when `force_destroy` is set (the post is already deleted), and makes `undoDeleteState()` accept opts so it can bail early for `force_destroy` — centralizing the guard instead of repeating it at each call site.
https://meta.discourse.org/t/398938
4 лайка
sam
(Sam Saffron)
Закрыл(а) тему
24.Март.2026 21:00:06
3
Эта тема была автоматически закрыта через 13 часов. Новые ответы больше не принимаются.