[TV] Show an alert when the server signs the user out - #5783
Conversation
|
Claude finished @sztomek's task in 4m 26s —— View job Review: [TV] Show an alert when the server signs the user out
Nice, well-scoped change — the signal-at-the-source approach is the right shape, the TV suppression is correctly scoped ( Findings below, roughly by importance. 1. Background forced sign-outs lose both the alert and the event
The dominant TV path is The PR frames this as "a delay, not a permanent gap," but for the background-refresh case it is permanent: nothing replays the signal on next launch. Since the parity metric here is the analytics event, this is worth closing — e.g. persist a 2. Repeat emissions re-fire
|
Review: [TV] Show an alert when the server signs the user out
View job run · branch |
|
Claude finished @sztomek's task in 1m 33s —— View job Review: [TV] Show an alert when the server signs the user out
Note: this synchronize event didn't change the diff — Re-verified findings1. Background forced sign-outs lose both the alert and the event — 2. Repeat emissions re-fire 3. The Log in button emits a contradictory second 4. Emit ordering vs. the in-flight sign-out job — 5. Smaller items (all still present)
6. PR description — the description lists "the account-removed listener" as a covered path, but as noted in #1 that listener is never started on TV. Narrows the coverage claim. What's good: signal-at-the-source is the right shape; Security / performance: nothing concerning. No new network or storage surface, the flow carries Not run: I did not execute |
geekygecko
left a comment
There was a problem hiding this comment.
This might work well with the changes to the account authentication PR. #5775
|
Claude finished @sztomek's task in 3m 7s —— View job Review: [TV] Show an alert when the server signs the user outReviewed only Blocking
Non-blocking
|

Description
Adds a server-forced sign-out alert to the Android TV app, matching Apple TV. When a user is signed out by the server (token revoked / refresh failed / account removed) rather than by their own action, iOS shows a full-screen alert instead of silently dropping them; Android TV previously surfaced nothing (only a system notification, which is invisible on a TV). This closes functional gap #5 from the Android-TV-vs-iOS-tvOS onboarding parity audit and lands the deferred
signed_out_alert_shownanalytics event (one of the three events split out of the onboarding-analytics PR #5773).How it works
UserManagergainsonServerSignOut: SharedFlow<Unit>, emitted fromsignOut()only whenwasInitiatedByUser == false(the Android equivalent of iOS'suser_initiated). Transient (replay = 0) = in-session only, matching iOS.TvOnboardingNavHostcollects the flow and navigates to a newSIGNED_OUTroute from any screen.TvSignedOutScreen(Compose + tv-material3, styled likeTvWelcomeScreen) shows "You've been logged out" + message + a Log in button;signed_out_alert_shownfires on appear. The button fully wipes local data (viaTvSignOutManager) and returns to Welcome — matching iOS'slogout().TokenErrorNotification(which already firesSignedOutAlertShownEvent) is suppressed on TV, so the in-app alert is the single event source.A user-initiated Log Out (Profile) is unaffected — it passes
wasInitiatedByUser = true, so no alert and no emit.Known limitation (conscious decision)
Because the TV token-error notification is suppressed, a forced sign-out that surfaces only via the OkHttp interceptor's swallowed
RefreshTokenExpiredException(rather thanRefreshPodcastsThreador the account-removed listener) won't show the alert until the next podcast refresh runs (refreshOnLaunch+ periodic). The primary forced-sign-out paths are covered; this is a delay, not a permanent gap.Fixes POC-867 https://linear.app/a8c/issue/POC-867/server-forced-signout-alerts
Testing Instructions
Screenshots or Screencast
Checklist
./gradlew spotlessApply)modules/services/localization/src/main/res/values/strings.xmlsigned_out_alert_shownalready exists in the schema; no new events added.)I have tested any UI changes...