[HLS] Rework HLS stream url selection logic#5497
Conversation
|
Claude finished @sztomek's task in 3m 25s —— View job Code ReviewI reviewed the HLS stream-resolution rework. Overall this is a clean refactor — dropping the persisted Review checklist
🟠 Main concern — possible
|
Generated by 🚫 Danger |
| database.execSQL("CREATE INDEX IF NOT EXISTS `episode_last_download_attempt_date` ON `podcast_episodes` (`last_download_attempt_date`)") | ||
| database.execSQL("CREATE INDEX IF NOT EXISTS `episode_podcast_id` ON `podcast_episodes` (`podcast_id`)") | ||
| database.execSQL("CREATE INDEX IF NOT EXISTS `episode_published_date` ON `podcast_episodes` (`published_date`)") | ||
| } |
There was a problem hiding this comment.
This feels like a really dangerous migration to do as this table could be very large. How about we remove adding the hls_url column before it goes to production?
val MIGRATION_131_132 = addMigration(131, 132) { database ->
database.execSQL("ALTER TABLE podcast_episodes ADD COLUMN hls_url TEXT") // delete this
}
There was a problem hiding this comment.
hmmm fair point, but we've already shipped database version 132 in our betas, so beta builds would break... as an alternative, we could keep the hls_url column untouched in the table but would not use its value in our domain layer.
what do you reckon? @geekygecko
There was a problem hiding this comment.
we've already shipped database version 132 in our betas, so beta builds would break...
If we leave the column for the beta users but remove the ALTER TABLE statement before we ship to production would there be an issue for either of them? I'm happy to do whatever you think but don't reckon we should do a full table copy.
There was a problem hiding this comment.
i think this would leave the app crashing for our beta users who installed the previous betas. claude has confirmed that as well, so i won't take this path.
as an alternative to full table migration, we should try dropping a column, but SQLite's ALTER TABLE … DROP COLUMN only exists since 3.35 and isn't available on older Android API levels, so the table-rebuild dance is the only portable way to actually remove a column.
i think the best course of action is to leave the column dormant and just get rid of the latest migration.
what are your thoughts, @geekygecko ?
|
Claude finished @sztomek's task in 3m 20s —— View job Re-review of PR #5497 — HLS stream url selection reworkRe-reviewed the latest state (through
✅ Resolved since last review
🟠 Migration
|
|
Claude finished @sztomek's task in 1m 35s —— View job Re-review — latest push (
|
e35b56f to
b376020
Compare
|
Claude finished @sztomek's task in 1m 57s —— View job Re-review of PR #5497 — HLS stream url selection reworkRe-reviewed the latest push (
✅ Resolved
🟠 Migration
|
|
Claude finished @sztomek's task in 1m 5s —— View job Re-review of PR #5497 — HLS stream url selection reworkReviewed the latest push (
✅ Resolved in this commit
🟠 Still the one open item — Migration
|
|
Claude finished @sztomek's task in 2m 47s —— View job Re-review of PR #5497 — HLS stream url selection reworkReviewed the latest push (
✅ Migration decision — Option B, correctly doneThe full-table
This is the lowest-risk path and avoids punishing the entire prod base with a rebuild — the right call. ✅ Previously-open items, all resolved
🟡 Minor (non-blocking)
Nice resolution — the migration approach is sound and the diff is clean. LGTM aside from the two minor nits above. Review feedback only — no code changed. |
Description
Previously we had
BaseEpisode.hlsUrlthat was assigned after data > domain > database conversion. This way we exposed only the first alternate enclosure, preventing us to read the entire list.This PR gets rid of
hls_urlcolumn from the database so we can work with the entire list as the server sends it.Fixes PCDROID-608 https://linear.app/a8c/issue/PCDROID-608/update-api-parsing-logic
Testing Instructions
Checklist
./gradlew spotlessApplyto automatically apply formatting/linting)modules/services/localization/src/main/res/values/strings.xml