Flusso di generazione del problema:
Eliminare il post
Eliminare permanentemente il post appena eliminato immediatamente, prima che siano trascorsi 5 minuti
Viene visualizzato il messaggio di attesa di 5 minuti come previsto
Dopo il ritorno automatico, si verifica un problema: il post eliminato viene ripristinato allo stato non eliminato e deve essere eliminato di nuovo, attendendo altri 5 minuti per l’eliminazione permanente.
1 Mi Piace
Grazie per la segnalazione Sarà risolto da
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 Mi Piace
sam
(Sam Saffron)
Chiuso
24 Marzo 2026, 9:00pm
3
Questo argomento è stato chiuso automaticamente dopo 13 ore. Non sono più ammesse nuove risposte.