diff --git a/Riot/Modules/Room/VoiceMessages/VoiceMessageController.swift b/Riot/Modules/Room/VoiceMessages/VoiceMessageController.swift index 01a57e742..1ee5288d1 100644 --- a/Riot/Modules/Room/VoiceMessages/VoiceMessageController.swift +++ b/Riot/Modules/Room/VoiceMessages/VoiceMessageController.swift @@ -352,7 +352,13 @@ public class VoiceMessageController: NSObject, VoiceMessageToolbarViewDelegate, samples: invertedSamples) { [weak self] success in UINotificationFeedbackGenerator().notificationOccurred((success ? .success : .error)) self?.deleteRecordingAtURL(sourceURL) - self?.deleteRecordingAtURL(destinationURL) + + // Do not delete the file to be sent if request failed, the retry flow will need it + // There's no manual mechanism to clean it up afterwards but the tmp folder + // they live in will eventually be deleted by the system + if success { + self?.deleteRecordingAtURL(destinationURL) + } } } } diff --git a/changelog.d/6160.bugfix b/changelog.d/6160.bugfix new file mode 100644 index 000000000..9e35700d6 --- /dev/null +++ b/changelog.d/6160.bugfix @@ -0,0 +1 @@ +Stop deleting audio recording when sending fails. \ No newline at end of file