Fluxo de geração do problema:
Excluir a postagem
Excluir permanentemente a postagem recém-excluída imediatamente, antes que os 5 minutos se passem
O aviso que indica que é preciso esperar 5 minutos aparece normalmente
Após o retorno automático, o problema ocorre: a postagem excluída é restaurada automaticamente para o estado não excluído, sendo necessário excluí-la novamente e esperar mais 5 minutos para a exclusão permanente.
1 curtida
Obrigado pelo relatório Isso será corrigido por meio de
main ← fix/permanently-delete-undoes-soft-delete
opened 04:24PM - 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 curtidas
sam
(Sam Saffron)
Fechado
Março 24, 2026, 9:00pm
3
Este tópico foi fechado automaticamente após 13 horas. Novas respostas não são mais permitidas.