Fixes #6160 - Stop deleting audio recording when sending fails and allow it to be retried through the normal mechanism

This commit is contained in:
Stefan Ceriu
2022-05-17 16:33:09 +03:00
committed by Stefan Ceriu
parent 783122e7f2
commit de6a633a23
2 changed files with 8 additions and 1 deletions
@@ -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)
}
}
}
}