Automattic / Automattic/pocket-casts-android
Subscribing silently fails if the network call fails
- Dominant language
- Kotlin
- Stars
- 2.8k
- Forks
- 308
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 143
Description
### Description
When subscribing to a podcast, the UI will update to reflect the "new" subscription state regardless of whether the network call to update the subscription succeeds, but the new, subscribed, subscription state is not persisted.
I think this occurs pretty much anywhere in the app where you can subscribe to a podcast:
- Full screen podcast page
- Discover
- Onboarding recommendations
Interestingly, this occurs when _subscribing_ to a podcast _even if the user isn't logged in_.
Also interesting: this issue does not occur when _unsubscribing_ from a podcast (the new unsubscribed state persists).
It feels like there are two, kinda separate but closely connected, issues here:
1. Subscribing to a podcast when offline doesn't persist
2. The UI indicates that the user is now subscribed to ^that^ podcast even though they are not.
Another issue that happens here that I noticed is that after unsuccessfully attempting to subscribe to a podcast while offline, if you then get online and try to subscribe to that same podcast you will have the same problem (UI says the podcast has been subscribed, but it really hasn't been).
### Step-by-step reproduction instructions
Subscribing doesn't stick...
2. Turn on airplane mode
3. Open the full page screen for a podcast you **are not subscribed to**
4. Tap the button to subscribe to that podcast
5. Exit the full page screen for that podcast
6. Return to the full page screen for that podcast
7. 💥 Observe that the subscription state for the podcast has reverted to not being subscribed.
8. Turn off airplane mode
9. Open the full page screen for that same podcast and tap the button to subscribe to it.
10. Exit the full screen page for that podcast and return to it.
11. 💥 Observe that the subscription state still hasn't persisted even though we're now online
12. Swipe the app away to close it
13. Reopen the app
14. Open the full screen page for that same podcast and subscribe to it
15. Exit the full screen page for that podcast and return to it
16. ✅ Observe that this time the subscription persisted
... but unsubscribing does
2. Turn on airplane mode
3. Open the full page screen for a podcast you **are already subscribed to**
4. Tap the button to unsubscribe from that podcast
5. Exit the full page screen for that podcast
6. Return to the full page screen for that podcast
7. ✅ Observe that the subscription state for the podcast has **not** reverted and still shows the unsubscribed state.
### Screenshots or screen recording
https://user-images.githubusercontent.com/4656348/213527223-b39207b0-bdee-4f8c-a528-a64d2cc93add.mov
### 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 12, Pocketcasts pre-7.31 build
Contributor guide
Research direction
Reproduce the offline subscription flow from the full-screen podcast page, then compare it with Discover and onboarding recommendations, the affected entry points named in the report. Trace subscription state and network-failure handling until the persisted state is clear; the work is done when failed subscribes do not leave a false UI state and successful online subscribes persist consistently while unsubscribe behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100