Drop the MediaStore explanation from the save helper

Review feedback: the retry itself is short enough to read, and the
platform limit it works around belongs in the commit, not the source.
The contract of the name helper keeps its one-line KDoc.
This commit is contained in:
hayaksi1
2026-08-09 15:40:20 +03:00
parent 17365a50d1
commit fbdb99019e
@@ -55,15 +55,6 @@ fun String.withFileNameSuffix(suffix: String): String {
}
}
/**
* Runs [saveAs] with [fileName], and runs it once more with a suffixed name if the platform failed to
* build a unique name for it.
*
* `MediaStore` de-duplicates the display name of a new file itself, but gives up after 32 conflicts
* and throws `IllegalStateException("Failed to build unique file")`, which makes saving a file with a
* common name such as `image.png` fail for good.
* See https://github.com/element-hq/element-x-android/issues/6371
*/
fun <T> saveWithUniqueFileName(
fileName: String,
uniqueSuffix: () -> String = { "_${System.currentTimeMillis()}" },