Automattic / Automattic/pocket-casts-android
App seems inconsistent in whether it resets the LocalPlayer after downloading an episode that is being streamed
- Dominant language
- Kotlin
- Stars
- 2.8k
- Forks
- 308
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 143
Description
### Description
I've noticed that when downloading a playing episode (i.e., if you start playing a new episode and you have auto download episodes added to up next turned on), once the download is complete, we usually, but not always reset the player.
I have only briefly looked into the issue, and I don't have time to look into it further, so I'm filing this issue as a reminder to follow-up on this when we have more time. At this point, it is not clear to me why we reset the player sometimes and not others.
It seems like either:
1. We should be resetting the player, and perhaps there are some negative consequences when we don't reset the player (although it's not clear to me right now what those are). I thought that maybe we were continuing to stream the podcast in that scenario, but that doesn't seem to be the case.
2. We do not need to be resetting the player every time we download and we can avoid doing that, which would be nice because it would let us avoid having the audio pause for approximately 1 second after the download completes while the player is being reset, or
3. There's a good reason we only need to reset the player some of the time, and I just haven't identified yet.
### Step-by-step reproduction instructions
1. Turn on the setting to auto download podcasts added to up next
2. Start playing a podcast that hasn't been downloaded
3. Observe that once the download completes, often, the logs show that we're resetting the player and there is an ~1 second pause in the audio. But observe that this does not always happen.
### Screenshots or screen recording
_No response_
### Did you search for existing bug reports?
- [X] I have searched for existing bug reports.
### Device, Operating system, and Pocket Casts app version
* Samsung A13, Android 13, Pocket Casts pre-release 7.52 build
* Pixel 4 emulator, Android 13, Pocket Casts pre-release 7.52 build
Contributor guide
Research direction
Start by reproducing the reported flow on Android with auto-download for episodes in Up Next enabled, and compare the logs when the download completes. Trace the download-completion and player-reset paths to determine why reset behavior differs; done means the intended behavior is established and the unwanted interruption or inconsistency is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100