Automattic / pocket-casts-ios

Pocket Casts iOS app 🎧
Mozilla Public License 2.0
1.67k stars 134 forks source link

Filters: episodes from unsubscribed podcasts added to the Unplayed filter #33

Open pocketcasts opened 2 years ago

pocketcasts commented 2 years ago

Initially reported in 5201571-zen and continued discussion on Slack: p1652147666837189-slack-C02A333D8LQ

This is the second time now I’ve launched the app and noticed a feed that I’m not subscribed to is populating one of my filters. The podcast is called Prestige TV and it’s showing up in my Unplayed filter. I’m not able to interact with any of the episodes in the filter list, and last time this happened I had to search for the podcast from Discover -> subscribe -> unsubscribe to clear the episodes out of my filter.

On May 12, it happened again but added other different podcast episodes to the filter:

https://user-images.githubusercontent.com/40906847/167990654-0793c81e-01ab-4e4b-aae2-e6eab73c6c67.MOV

App Version: 7.20 Device: iPhone14,2 OS: 15.5

pocketcasts commented 2 years ago

Aditional info from Russell:

I'm not really sure what would cause this, but the behaviour leads me to believe that:

The next step I think would be to manually simulate this by running a query to just delete a podcast from the database without clearing the episodes. Once we know the behaviour is identical we could try to figure out what caused it

The above seems to be confirmed in the code. Podcasts are removed from a filter query by doing a NOT IN operation, meaning if they aren't on the device but the episodes the episodes would still appear:

let unsubscribedUuids = DataManager.sharedManager.allUnsubscribedPodcastUuids()
        if unsubscribedUuids.count > 0 {
            if haveStartedWhere { queryString += "AND " }

            queryString += " podcastUuid NOT IN ("