From f29d1374f62ef118f770e6ec83394ed8b2fa30fc Mon Sep 17 00:00:00 2001 From: Divyansh Goyal Date: Wed, 17 Jun 2026 01:45:07 +0530 Subject: [PATCH] fix: persist ignored-version lock so updates are suppressed ProductPreferences emitted lock changes through a MutableSharedFlow with no buffer (replay = 0, extraBufferCapacity = 0), so tryEmit() silently dropped the event when the collector was not ready. The SharedPreferences entry was saved, but the matching row in the lock table was never written, so the Updates tab and update notifications kept treating the ignored version as updatable until the next app restart rebuilt the lock table. Give the flow an unbounded buffer so tryEmit() never drops the event and the lock is written reliably. Fixes #1309 --- .../kotlin/com/looker/droidify/content/ProductPreferences.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/looker/droidify/content/ProductPreferences.kt b/app/src/main/kotlin/com/looker/droidify/content/ProductPreferences.kt index f2f111208..5605b4e52 100644 --- a/app/src/main/kotlin/com/looker/droidify/content/ProductPreferences.kt +++ b/app/src/main/kotlin/com/looker/droidify/content/ProductPreferences.kt @@ -19,7 +19,9 @@ import kotlinx.coroutines.launch object ProductPreferences { private val defaultProductPreference = ProductPreference(false, 0L) private lateinit var preferences: SharedPreferences - private val mutableSubject = MutableSharedFlow>() + private val mutableSubject = MutableSharedFlow>( + extraBufferCapacity = Int.MAX_VALUE, + ) private val subject = mutableSubject.asSharedFlow() fun init(context: Context, scope: CoroutineScope) {