Make sure we clean up the pre-processed and uploaded media (#5039)

* Add `MediaSender.cleanUp()` and `MediaPreProcessor.cleanUp()` methods: this will remove the temporary files created when pre-processing media before sending them.

* Make sure we clean up also the previous temporary media.

* Fix the condition for the custom back handler in the attachments preview screen

* Tests: check the clean up is performed when needed
This commit is contained in:
Jorge Martin Espinosa
2025-07-23 08:55:20 +02:00
committed by GitHub
parent 746699b468
commit b219c05d06
7 changed files with 65 additions and 8 deletions

View File

@@ -26,6 +26,9 @@ class FakeMediaPreProcessor(
var processCallCount = 0
private set
var cleanUpCallCount = 0
private set
private var result: Result<MediaUploadInfo> = Result.success(
MediaUploadInfo.AnyFile(
File("test"),
@@ -108,4 +111,8 @@ class FakeMediaPreProcessor(
)
)
}
override fun cleanUp() {
cleanUpCallCount += 1
}
}