straw/buildSrc
Kayos d1ee9379e0 vc=36: audit-fix tail — atomic setPlayingFrom, cache wipe, polish
The deferred items from the vc=35 audit-fix sprint. Smaller surface,
real impact:

HIGH-C6 — atomic setPlayingFrom claim
  StrawMediaController.setPlayingFrom previously did
    if (NowPlaying.current.value?.streamUrl == streamUrl) return
    setMediaItem(...); prepare(); play()
    NowPlaying.set(...)
  When the inline player and fullscreen Player effects fired in the
  same composition pass (an inline → fullscreen transition), both
  checks could see the stale NowPlaying value, both passed the
  guard, both ran setMediaItem + prepare + play. Result: an audible
  "did the video just restart?" stutter that was hard to reproduce.
  New: NowPlaying.claim(item) uses MutableStateFlow.compareAndSet
  in a CAS loop. Returns true ONLY for the caller that won the
  race; losing caller bails before touching the controller. The
  guard is now actually atomic, not a check-then-set.

MED-Q11 — minibar surfaces playback errors
  Background button takes the user to Home with audio continuing in
  the foreground service. If that audio then fails (transient network
  drop on the resolved URL), neither the inline-player error listener
  nor PlayerScreen's exist anymore — only the minibar is observing.
  Added onPlayerError to MinibarOverlay's listener: Toast the
  errorCodeName + clear NowPlaying so the minibar hides itself
  rather than claiming a dead session is loaded.

MED-Q15 — pre-compute recencyScore once
  mergeFromCache's compareByDescending invoked recencyScore() twice
  per pair (compareBy semantics), so ~1800 regex matches on a 900-
  item merge. Pair the score with the item once, sort the pair, take
  the items back. N matches.

MED-C13 — Settings cache-wipe also clears in-memory VM
  SubscriptionFeedViewModel.clearInMemoryCache() exposed; Settings's
  Switch.onCheckedChange(false) now calls it alongside the disk
  wipe. Without this the feed kept rendering its in-memory mirror
  until process death.

MED-C5 — drop StrawHome.formatDurationShort
  Near-duplicate of util.formatDuration. Used util's version + the
  existing `if (durationSeconds > 0)` guard at the call site already
  produces identical output (util returns "" on sec <= 0).

MED-C19 — drop unused Surface import in StrawHome.

NowPlaying gained one public method (claim). Everything else is
internal-only churn.
2026-05-25 13:43:45 -07:00
..
src/main/kotlin vc=36: audit-fix tail — atomic setPlayingFrom, cache wipe, polish 2026-05-25 13:43:45 -07:00
build.gradle.kts Relocate toml lint task to buildSrc and extend against default task 2025-11-21 20:08:26 +08:00