fix(playback): prevent stale stream URLs from stalling playback - #4132
fix(playback): prevent stale stream URLs from stalling playback#4132jahruz67 wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe PR adds a synchronized expiring LRU ChangesStream URL cache lifecycle
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MusicService
participant StreamUrlCache
participant DownloadUtil
MusicService->>StreamUrlCache: Request cached stream URL
StreamUrlCache-->>MusicService: Return fresh URL or null
DownloadUtil->>StreamUrlCache: Store fetched URL with TTL
DownloadUtil->>StreamUrlCache: Invalidate URL after expiry or removal
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Can I download the apk with the fixed issues? |
|
@novakjakov2 did you try the latest APK release, it fixes most playback issues |
Yes, playing certain songs does not work. The player just keeps spinning but not loading the song. |
Maybe you could fork my fork and build that APK or go to actions and download the build from latest from the latest commit. https://github.com/MetrolistGroup/Metrolist/actions/workflows/build.yml Also, make sure when you update it to the latest release that you have cleared the app storage and cleared the cache. Because sometimes that may affect your update. |
I installed the app for the first time. Should I try reinstalling? |
That may help |
nyxiereal
left a comment
There was a problem hiding this comment.
Please rebase and resolve the playback conflicts while preserving current recovery logic. Stream URL expiry should use a monotonic clock such as elapsedRealtime(), followed by a current build and stale URL retry tests.
Problem
Playback and downloads can become stuck loading after the app remains in the background long enough for a YouTube stream URL to expire.
Cause
Download URL expiration was stored as a relative duration instead of an absolute timestamp, and the validity comparison was reversed. This caused expired URLs to be reused. Stream validation responses were also not closed, potentially leaking network resources.
Solution
Testing
git diff --check.Related Issues
Summary by CodeRabbit
Bug Fixes
Performance
Tests