Flujo de generación del problema:
Eliminar la publicación.
Eliminar permanentemente la publicación anterior inmediatamente, antes de que pasen 5 minutos.
Aparece normalmente el aviso de que hay que esperar 5 minutos.
Aparece un problema al volver automáticamente: la publicación eliminada se restaura al estado no eliminado y debe eliminarse de nuevo, y luego esperar otros 5 minutos para la eliminación permanente.
1 me gusta
Gracias por el informe Esto se solucionará mediante
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 Me gusta
sam
(Sam Saffron)
Cerrado
24 Marzo, 2026 21:00
3
Este tema se cerró automáticamente después de 13 horas. Ya no se permiten nuevas respuestas.