Skip to content

fix(playback): handle rejected cleartext media origin - #234

Draft
Quick104 wants to merge 1 commit into
mainfrom
codex/issue-233-cleartext-crash
Draft

fix(playback): handle rejected cleartext media origin#234
Quick104 wants to merge 1 commit into
mainfrom
codex/issue-233-cleartext-crash

Conversation

@Quick104

Copy link
Copy Markdown
Contributor

Problem

The media cleartext-origin guard threw an unchecked IllegalStateException from an OkHttp network interceptor. OkHttp delivered a cancellation to the callback and then rethrew the unchecked exception on its dispatcher thread, terminating the Android process when playback encountered an unapproved cleartext redirect.

Approach

  • Convert the media-interceptor rejection into a dedicated IOException so OkHttp and Media3 handle it as a normal playback failure.
  • Keep the origin check before downstream transport, preserving the existing fail-closed credential boundary.
  • Use a generic error message that does not expose the rejected origin.
  • Add synchronous and asynchronous redirect coverage, including proof that the downstream server is not contacted and no exception escapes the dispatcher thread.

Verification

  • ./gradlew :android-shared:testDebugUnitTest --tests org.siloserver.silo.common.player.MediaAuthInterceptorTest --no-daemon --max-workers=2
  • ./gradlew :android-shared:testDebugUnitTest :androidApp:assembleDebug :androidTvApp:assembleDebug --no-daemon --max-workers=2
  • git diff --check

All tests passed, and both phone and TV debug APKs assembled successfully. An independent review found no correctness, privacy, or security issues.

Closes #233

AI-use disclosure

  • Tools: OpenAI Codex
  • Models: GPT-5 and GPT-5.6-Sol
  • Involvement: AI-assisted diagnosis, implementation, regression testing, privacy review, and independent code review under maintainer direction.

🤖 Generated with OpenAI Codex

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3811c2d2-cdcf-4d08-9d2c-f05b9e557fc2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent cleartext media rejection from crashing the Android process

1 participant