Skip to content

Conversation

@bjtitus
Copy link
Contributor

@bjtitus bjtitus commented Oct 7, 2025

Fixes PCIOS-175

There are two primary fix attempts here:

  • Make sure we are fetching and passing shouldSubscribe when we call serverPodcastManager.addFromUuid. Otherwise, we could potentially subscribe to a Podcast which the server already told us is unsubscribed.
  • When importing a podcast, we seemed to be setting subscribed based on the isDeleted value. It seems like we should also use subscribed if only it exists. I'm not 100% sure on why we ever use isDeleted, but I decided to keep that for now. It only happens in specific cases where checkIsDeleted is true but this might be something to look at in the future.

So both fixes really come down to using the server's subscribed value where we weren't before.

To test

  • Use two devices to test syncing
  • Subscribe to a podcast on one device
  • Refresh in the Profile tab to sync
  • Unsubscribe on another device
  • Refresh in the Profile tab to sync
  • Verify that podcasts are properly synced and removed from lists

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

Ensure sync progress notifications always fire: Wraps importPodcast’s progress counter updates in a defer so every exit path still posts syncProgressPodcastUpto and syncProgressPodcastCount, preserving UI accuracy when we return early.
This allows us to more easily bail out with early returns in cases where we may want to (podcast is deleted or unsubscribed)
Respect server subscription intent for new podcasts: Adds a derived shouldSubscribe flag and passes it through to addFromUuid, preventing re-subscribing podcasts the server reports as unsubscribed.

We could also short-circuit the addFromUUID call on shouldSubscribe being false but I figured we may be better off keeping that functionality as is.
Uses the subscribed value instead of updating to isDeleted. This should help in case we only receive subscribed and not isDeleted. We won't want to set subscribed to 0 when isDeleted is missing but subscribed is 0
@bjtitus bjtitus mentioned this pull request Oct 7, 2025
3 tasks
@bjtitus bjtitus changed the title Bjtitus/resubscription fixes Re-subscription fixes Oct 7, 2025
@bjtitus bjtitus changed the title Re-subscription fixes Podcast Re-subscription fixes Oct 7, 2025
@bjtitus bjtitus marked this pull request as ready for review October 7, 2025 02:47
@bjtitus bjtitus requested a review from a team as a code owner October 7, 2025 02:47
@bjtitus bjtitus requested review from SergioEstevao and removed request for a team October 7, 2025 02:47
@bjtitus bjtitus added this to the 7.100 milestone Oct 7, 2025
@bjtitus bjtitus added [Type] Other Issues not covered by other types, such as polish, refactoring and documentation. [Type] Bug Used for issues where something is not functioning as intended. Bug and removed [Type] Other Issues not covered by other types, such as polish, refactoring and documentation. labels Oct 7, 2025
This behavior was changed a bit last minute to keep the podcast in the DB with the subscribed value set rather than skipping adding it.
@pocketcasts pocketcasts modified the milestones: 7.100, 7.101 Oct 14, 2025
@pocketcasts
Copy link
Contributor

Version 7.100 has now entered code-freeze, so the milestone of this PR has been updated to 7.101.

@SergioEstevao
Copy link
Contributor

@bjtitus and I tested this together and we think this PR needs some extra checks to see if all the logic is solid taking in account our server implementation for sync

@pocketcasts pocketcasts modified the milestones: 7.101, 7.102 Oct 27, 2025
@pocketcasts
Copy link
Contributor

Version 7.101 has now entered code-freeze, so the milestone of this PR has been updated to 7.102.

@SergioEstevao
Copy link
Contributor

@bjtitus are you still looking into this? Should I remove myself as reviewer?

@SergioEstevao SergioEstevao removed their request for review October 31, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug [Type] Bug Used for issues where something is not functioning as intended.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants