You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wanted to alert you to a massive bug I discovered. I've been maintaining my separate branch for a project I'm working on. I have a lot of custom models linked to the Enclosure model by foreign key. Then the other day, I noticed all my records linked to enclosures for a specific source suddenly vanished.
It took me a while, but I think I've tracked it down to the parse_feed_json() method. You have logic there to delete old enclosures if their URL doesn't exist in the current feed. That's usually not a problem. However, many RSS feeds wrap the true podcast URL with a prefix URL to track downloads, and occasionally these tracker URLs change. When that happens, that causes this code to delete all the enclosure records, and, in my case, everything attached to them.
My patch for this is to remove the calls to delete(), so I never risk wiping out my database when some podcast server switches up its tracking links. I've also disabled the logic to create an enclosure if the URL is new, since that allows logical duplicates where the same MP3 url has two different tracking links prepended to it. It seems safe to only create a new enclosure if none exist, since 99.99% of the time, a post only ever has one enclosure.
I'd submit a PR, but my codebase has diverged so much from yours, it would be a little unwieldy. I just want to give you a heads up, so this problem doesn't bite you too.
The text was updated successfully, but these errors were encountered:
Hi,
Just wanted to alert you to a massive bug I discovered. I've been maintaining my separate branch for a project I'm working on. I have a lot of custom models linked to the Enclosure model by foreign key. Then the other day, I noticed all my records linked to enclosures for a specific source suddenly vanished.
It took me a while, but I think I've tracked it down to the
parse_feed_json()
method. You have logic there to delete old enclosures if their URL doesn't exist in the current feed. That's usually not a problem. However, many RSS feeds wrap the true podcast URL with a prefix URL to track downloads, and occasionally these tracker URLs change. When that happens, that causes this code to delete all the enclosure records, and, in my case, everything attached to them.My patch for this is to remove the calls to delete(), so I never risk wiping out my database when some podcast server switches up its tracking links. I've also disabled the logic to create an enclosure if the URL is new, since that allows logical duplicates where the same MP3 url has two different tracking links prepended to it. It seems safe to only create a new enclosure if none exist, since 99.99% of the time, a post only ever has one enclosure.
I'd submit a PR, but my codebase has diverged so much from yours, it would be a little unwieldy. I just want to give you a heads up, so this problem doesn't bite you too.
The text was updated successfully, but these errors were encountered: