fix(android): look gains up by key, not value (M464 #5000)
release / govulncheck (push) Successful in 16s
release / web (push) Successful in 1m28s
release / go (push) Successful in 1m43s
release / integration (push) Successful in 4m38s
release / android (push) Successful in 5m19s
release / Build signed APK (releases and dev) (push) Successful in 5m30s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 1m13s
release / Verify release artifacts (tag releases only) (push) Skipped

`id in map` on a ConcurrentHashMap resolves to its legacy contains(),
which tests values (KT-18053); the compiler refuses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-06 19:18:15 -04:00
co-authored by Claude Opus 5.5
parent 1013c283da
commit 92c3f9bdb8
@@ -64,7 +64,7 @@ class ReplayGainStore internal constructor(
fun request(trackIds: Collection<String>) {
val now = clock()
val wanted = trackIds.filter { id ->
id !in gains &&
!gains.containsKey(id) &&
(missedAt[id]?.let { now - it > MISS_RETRY_MS } ?: true) &&
inflight.add(id)
}
@@ -80,7 +80,7 @@ class ReplayGainStore internal constructor(
internal suspend fun load(ids: List<String>) {
fromCache(ids)
val rest = ids.filter { it !in gains }
val rest = ids.filter { !gains.containsKey(it) }
val health = serverHealth()
if (rest.isEmpty() || health == ServerHealth.Offline || health == ServerHealth.ServerDown) return
for (batch in rest.chunked(MAX_IDS_PER_REQUEST)) {