-
Notifications
You must be signed in to change notification settings - Fork 3
.pr_agent_accepted_suggestions
| PR 832 (2026-07-08) |
[reliability] AppCheck telemetry init race
AppCheck telemetry init race
BoxLoreApplication calls setupAppCheck() before PostHogAndroid.setup(), but the App Check pre-warm callbacks immediately call AnalyticsHelper.trackAppCheckStatus(), which calls PostHog.capture() with no initialization guard. If the token task resolves quickly, the event can be lost (or behave inconsistently) because PostHog may not be ready yet.setupAppCheck() runs before PostHogAndroid.setup(), but setupAppCheck() may emit AnalyticsHelper.trackAppCheckStatus(...) from async callbacks. Since trackAppCheckStatus() calls PostHog.capture() directly (no init check), this creates a race where the App Check adoption/health event can be dropped or behave inconsistently.
-
BoxLoreApplication.onCreate()invokessetupAppCheck()before PostHog initialization. -
setupAppCheck()pre-warms App Check and tracks status in the success/failure listeners. -
AnalyticsHelper.trackAppCheckStatus()callsPostHog.capture()unguarded.
- app/src/main/java/cx/aswin/boxcast/BoxLoreApplication.kt[20-35]
- app/src/main/java/cx/aswin/boxcast/BoxLoreApplication.kt[84-112]
- core/data/src/main/java/cx/aswin/boxcast/core/data/analytics/AnalyticsHelper.kt[118-132]
- Prefer moving
PostHogAndroid.setup(this, config)beforesetupAppCheck()so any telemetry emitted from App Check callbacks has PostHog ready. - Alternatively, delay/queue the
trackAppCheckStatuscall until after PostHog is initialized (e.g., by setting a flag afterPostHogAndroid.setupand only capturing when true).
[maintainability] Duplicate EOE sentinel value
Duplicate EOE sentinel value
SleepTimerPopup introduces END_OF_EPISODE_MINUTES = 999 while PlaybackRepository.setSleepTimer() separately uses the literal 999 to trigger end-of-episode behavior. Duplicating the sentinel across modules risks future drift that would break end-of-episode timers.The end-of-episode sleep timer sentinel (999) is duplicated: defined as END_OF_EPISODE_MINUTES in the UI layer and checked as a magic number in PlaybackRepository. If either side changes, end-of-episode selection will silently stop working.
- UI emits
minutes=999for "End of episode". - PlaybackRepository enables EOE mode when
durationMinutes == 999.
- core/designsystem/src/main/java/cx/aswin/boxcast/core/designsystem/components/SleepTimerPopup.kt[45-62]
- core/data/src/main/java/cx/aswin/boxcast/core/data/PlaybackRepository.kt[1766-1786]
- Move the sentinel into a shared constant (e.g.,
core/modelorcore/data), or model the selection as a sealed type (FixedMinutes vs EndOfEpisode) so the UI cannot send a magic number.
[security] App Check token logged
App Check token logged
NetworkModule injects the X-Firebase-AppCheck header, while HttpLoggingInterceptor runs at HEADERS level in debug builds without redacting that header. This will print App Check tokens to logcat in debug/test builds.Debug builds log request headers via OkHttp's HttpLoggingInterceptor.Level.HEADERS. Since the new interceptor adds X-Firebase-AppCheck, the token will be printed to logcat unless explicitly redacted.
-
appCheckInterceptoraddsX-Firebase-AppCheck. -
loggingInterceptoris configured forHEADERSin debug builds.
- core/network/src/main/java/cx/aswin/boxcast/core/network/NetworkModule.kt[31-62]
- Add
loggingInterceptor.redactHeader("X-Firebase-AppCheck"). - Consider also redacting
X-App-Keyif it is sensitive in logs. - Keep the interceptor ordering, but ensure redaction happens on the logging interceptor instance used by the client.
| PR 830 (2026-07-08) |
[performance] DB inspector eagerly composes lists
DB inspector eagerly composes lists
DbInspectorSection renders history/podcasts via `forEach` inside a `Column`, which eagerly composes all rows when the tab is visible instead of virtualizing. With history emitting up to 300 items (and subscriptions unbounded), this can cause avoidable UI jank and slow tab switches.DbInspectorSection uses Column { history.forEach { ... } } / podcasts.forEach { ... }, which composes every row eagerly. This is a regression from the deleted dialog’s LazyColumn(items(...)) approach and can cause jank when opening the inspector or switching tabs.
-
ListeningHistoryDao.getAllHistory()returns up to 300 rows. -
PodcastDao.getSubscribedPodcasts()returns all subscribed podcasts (no limit).
- feature/home/src/main/java/cx/aswin/boxcast/feature/home/DebugScreen.kt[272-299]
- core/data/src/main/java/cx/aswin/boxcast/core/data/database/ListeningHistoryDao.kt[35-44]
- core/data/src/main/java/cx/aswin/boxcast/core/data/database/PodcastDao.kt[15-20]
- Replace the inner
Column+forEachwith aLazyColumn(orLazyColumninside a fixed-height container) usingitems(...). - Optionally add basic keys:
items(history, key = { it.episodeId }) { ... }items(podcasts, key = { it.podcastId }) { ... }
[observability] Sleep prompt analytics misclassified
Sleep prompt analytics misclassified
SleepTimerPopup invokes onDismiss both for inactivity auto-hide and for the post-selection confirmation timeout, but MainActivity’s onDismiss always tracks decision="dismiss". As a result, a successful timer selection will also emit a "dismiss" decision event (and timeouts can’t be distinguished from manual dismiss).SleepTimerPopup calls onDismiss() for multiple semantics (manual dismiss, auto-hide timeout, and confirmation auto-dismiss). In MainActivity, onDismiss always logs trackLateNightSafeguardDecision("dismiss"), so analytics are wrong (timer-set flow records an extra dismiss) and you lose the ability to distinguish timeout vs user dismiss.
-
SleepTimerPopuptriggersonDismiss()afterautoHideMillisand after the confirmation delay. -
MainActivitywiresonDismissto unconditional analytics decisiondismiss.
- core/designsystem/src/main/java/cx/aswin/boxcast/core/designsystem/components/SleepTimerPopup.kt[61-90]
- app/src/main/java/cx/aswin/boxcast/MainActivity.kt[2341-2362]
- Change the API to carry a reason, e.g.:
enum class SleepTimerPopupDismissReason { Manual, Timeout, Confirmation }onDismiss: (SleepTimerPopupDismissReason) -> Unit
- In
SleepTimerPopup:- Close icon ->
Manual - auto-hide ->
Timeout - confirmation delay ->
Confirmation
- Close icon ->
- In
MainActivity:- Track
dismissonly forManual - Track
ignore(or a new decision) forTimeout - Do not track
dismissforConfirmation(timer selection already trackstimer_set).
- Track
| PR 816 (2026-07-06) |
[correctness] Session counters never reset
Session counters never reset
LearnViewModel.trackScreenExit() reports cumulative counts (dismiss/queue/play/etc.) because the counters are never cleared when a new Learn session begins. This makes later learn_screen_session events internally inconsistent (time_spent_seconds covers the latest interval while counts include prior intervals).LearnViewModel emits learn_screen_session with counters that are never reset, so session summaries become cumulative across visits/resumes.
The session timer is restarted on resume (onScreenResume()), but the action counters are not, so the reported metrics drift.
- feature/explore/src/main/java/cx/aswin/boxcast/feature/explore/LearnViewModel.kt[38-66]
- Add a private
resetTelemetrySession()that setscardsDismissedCount/cardsQueuedCount/playsCount/podcastsClickedCount/infosClickedCountback to 0. - Call it when starting a new session (e.g., inside
onScreenResume()whenhasTrackedExitis true, alongside resettingsessionStartTime). - Optionally also reset after emitting in
trackScreenExit()if you want each emitted event to represent an independent session.
| PR 807 (2026-07-05) |
[correctness] Accent color mismatch
Accent color mismatch
LearnScreen derives the palette extraction image from state.data.questionsStack, but the UI renders the swipe stack from state.questionsStack; after shuffling or dismissing, the header tint can come from a different (or already dismissed) card than the one on top.LearnScreen extracts the accent color from state.data.questionsStack.firstOrNull() while the rendered card stack uses state.questionsStack. This desynchronizes the logo tint from the visible top card after shuffle/dismiss.
LearnUiState.Success carries questionsStack specifically for the active stack shown on screen.
- feature/explore/src/main/java/cx/aswin/boxcast/feature/explore/LearnScreen.kt[153-235]
- Change the palette source to
state.questionsStack.firstOrNull()(the same list passed intoCuriosityCardStack). - Ensure the
LaunchedEffect/rememberkeys are tied to that active top-card image so the tint updates when the top card changes.
| PR 803 (2026-07-04) |
[reliability] Fixed text height risk
Fixed text height risk
Multiple card components hard-code the text block to `height(58.dp)`, which can clip titles/subtitles under larger system font scales or future typography token changes.Several cards force their text area to a fixed 58.dp height. This makes the layout brittle: if font scale increases (accessibility) or typography sizes change, text can be clipped because the container cannot grow.
This pattern appears in multiple card components that display a 2-line title + 1-line subtitle.
- Replace
.height(58.dp)with a more resilient constraint:- use
heightIn(min = 58.dp)and allow growth, or - use
defaultMinSize(minHeight = 58.dp)/wrapContentHeight()depending on desired behavior.
- use
- If the goal is consistent card heights, consider measuring based on typography tokens or using
minLines+ consistentlineHeightwithout hard capping the container.
- feature/home/src/main/java/cx/aswin/boxcast/feature/home/components/PodcastCard.kt[114-133]
- feature/home/src/main/java/cx/aswin/boxcast/feature/home/components/CuratedEpisodeCard.kt[109-129]
- feature/home/src/main/java/cx/aswin/boxcast/feature/home/components/ForYouSection.kt[408-428]
[performance] remember keyed by list
remember keyed by list
`gridState` uses `remember(..., gridItems.list)` even though it only derives a simple loading/content string, adding avoidable list equality work during recompositions.gridState is memoized with gridItems.list as a key, which can trigger structural equality checks for the list during recompositions, even though the derived value only depends on isLoading, isFilterLoading, and whether the list is empty.
This code runs inside the Home feed composable where recompositions can be frequent.
- Change the
rememberkeys to only the needed scalars (e.g.,gridItems.list.isEmpty()orgridItems.list.size). - Alternatively, use
derivedStateOfwithout including the whole list as a key.
- feature/home/src/main/java/cx/aswin/boxcast/feature/home/HomeScreen.kt[915-920]
| PR 800 (2026-07-03) |
[reliability] Stale last-seen keys accumulate
Stale last-seen keys accumulate
HomeRoute and PodcastInfoViewModel write lastSeenEpisodeId for any viewed podcast with a latestEpisode, even when the podcast isn’t subscribed; those entries are only removed on unsubscribe, so they can persist indefinitely and grow the DataStore preferences set. This increases the work done on every preferences read because lastSeenEpisodesStream scans all prefs and filters by prefix.setLastSeenEpisodeId() is invoked for podcasts that may not be subscribed (e.g., Home recommendations and general PodcastInfo loads). Since removeLastSeenEpisodeId() is only called on unsubscribe, this leaves behind persistent per-podcast DataStore keys that can accumulate and slow preference reads/mapping.
The stored last-seen mapping is only meaningful for subscribed podcasts (both isEpisodeNew() helpers require subscribedAt > 0). Writing entries for non-subscribed podcasts provides no benefit but increases stored preference keys and the cost of lastSeenEpisodesStream.
- feature/home/src/main/java/cx/aswin/boxcast/feature/home/HomeScreen.kt[207-226]
- feature/home/src/main/java/cx/aswin/boxcast/feature/home/HomeViewModel.kt[231-235]
- feature/info/src/main/java/cx/aswin/boxcast/feature/info/PodcastInfoViewModel.kt[285-291]
- feature/info/src/main/java/cx/aswin/boxcast/feature/info/PodcastInfoViewModel.kt[326-330]
- Only call
setLastSeenEpisodeId(podcastId, episodeId)when the podcast is subscribed.- In
HomeViewModel.markPodcastEpisodeAsSeen, checksubscriptionRepository.isSubscribed(podcastId)before writing. - In
PodcastInfoViewModel.loadPodcast, reuse the already-computedisSubscribedflag to guard bothsetLastSeenEpisodeIdcalls.
- In
- Optionally add a periodic cleanup routine (e.g., on app start) that removes
last_seen_episode_id_*keys for podcastIds not insubscribedPodcastIds, if you want defense-in-depth.
[correctness] NEW badge ignores play status
NEW badge ignores play status
Subscriptions Shows tab now computes the NEW badge solely from publish time + lastSeenId and no longer considers podcast.episodeStatus, so the badge can appear even when the latest episode is already completed/in-progress. This is misleading because LibraryViewModel explicitly enriches podcasts with episodeStatus from listening history.The Shows grid card NEW indicator no longer checks podcast.episodeStatus, so it can display NEW for podcasts whose latest episode is already completed or in progress.
LibraryViewModel enriches each subscribed podcast with episodeStatus derived from listening history. The Shows tab previously used this to only show the indicator for UNPLAYED, but the new isEpisodeNew()/hasRecentNew path ignores it.
- feature/library/src/main/java/cx/aswin/boxcast/feature/library/SubscriptionsScreen.kt[1256-1281]
- feature/library/src/main/java/cx/aswin/boxcast/feature/library/SubscriptionsScreen.kt[1331-1353]
- feature/library/src/main/java/cx/aswin/boxcast/feature/library/LibraryViewModel.kt[103-138]
- Gate the NEW badge with episode status, e.g.:
val shouldShowNew = (podcast.episodeStatus == EpisodeStatus.UNPLAYED) && isEpisodeNew(...)- or, if desired:
podcast.episodeStatus != EpisodeStatus.COMPLETED.
- Keep the
lastSeenIdsuppression as-is so users can dismiss the badge by viewing the show.
| PR 780 (2026-06-28) |
[maintainability] Dead isDarkTheme parameter
Dead isDarkTheme parameter
FullPlayerContent still requires an isDarkTheme parameter, but system-bar appearance now uses LocalEffectiveDarkTheme instead, leaving misleading API surface and no-op argument plumbing from call sites.FullPlayerContent keeps an isDarkTheme parameter, but the function no longer uses it after switching to LocalEffectiveDarkTheme.current. This makes call sites look meaningful while having no effect.
UnifiedPlayerSheet now passes effectiveDarkTheme into isDarkTheme, but FullPlayerContent ignores it.
Remove isDarkTheme from FullPlayerContent’s signature and update all call sites accordingly (or reintroduce using the parameter if you intentionally want the composable to be theme-agnostic).
- feature/player/src/main/java/cx/aswin/boxcast/feature/player/FullPlayerContent.kt[79-94]
- feature/player/src/main/java/cx/aswin/boxcast/feature/player/FullPlayerContent.kt[181-187]
- feature/player/src/main/java/cx/aswin/boxcast/feature/player/UnifiedPlayerSheet.kt[543-548]