From c5cdcdfd3f06e4a301a7db6903daf20780cfa825 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Wed, 1 Oct 2025 08:47:02 -0300 Subject: [PATCH] [download] limit download progress reporting to once per second More often isn't needed and runs into issues with UI refresh rates and worse notification rate-limiting which causes important notifications to get missed --- .../src/androidMain/kotlin/org/fdroid/download/Downloader.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/download/src/androidMain/kotlin/org/fdroid/download/Downloader.kt b/libs/download/src/androidMain/kotlin/org/fdroid/download/Downloader.kt index 2faecec70..9244acad2 100644 --- a/libs/download/src/androidMain/kotlin/org/fdroid/download/Downloader.kt +++ b/libs/download/src/androidMain/kotlin/org/fdroid/download/Downloader.kt @@ -180,7 +180,7 @@ public abstract class Downloader( private fun reportProgress(lastTimeReported: Long, bytesRead: Long, bytesTotal: Long): Long { val now = System.currentTimeMillis() - return if (now - lastTimeReported > 100) { + return if (now - lastTimeReported > 1000) { log.debug { "onProgress: $bytesRead/$bytesTotal" } progressListener?.onProgress(bytesRead, bytesTotal) now