Ashinch / ReadYou

An Android RSS reader presented in Material You style.
GNU General Public License v3.0
4.53k stars 183 forks source link

Give clear error messages after OPML import fails #394

Open mmkthecoolest opened 1 year ago

mmkthecoolest commented 1 year ago

1. Environment

2. Describe the bug

OPML import doesn't work when using the import OPML option. No error message is displayed and no feeds are imported. Adding all the listed feeds manually works.

OPML content:

<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.1">
  <head>
    <title>RSS Feeds</title>
  </head>
  <body>
    <outline text="Tech - News">
      <outline htmlUrl="https://arstechnica.com" type="rss" text="Serving the Technologist for more than a decade. IT news, reviews, and analysis." title="Ars Technica" xmlUrl="https://feeds.arstechnica.com/arstechnica/index" />
      <outline htmlUrl="https://www.theverge.com/" type="rss" text="" title="The Verge -  All Posts" xmlUrl="https://www.theverge.com/rss/index.xml" />
      <outline htmlUrl="https://www.techspot.com" type="rss" text="TechSpot News - All Stories" title="TechSpot" xmlUrl="https://www.techspot.com/backend.xml" />
      <outline htmlUrl="https://www.theregister.com/" type="rss" text="Biting the hand that feeds IT — Enterprise Technology News and Analysis" title="The Register" xmlUrl="https://www.theregister.com/headlines.atom" />
      <outline htmlUrl="https://www.engadget.com/" type="rss" text="Engadget is a web magazine with obsessive daily coverage of everything new in gadgets and consumer electronics" title="Engadget" xmlUrl="https://www.engadget.com/rss.xml" />
      <outline htmlUrl="https://www.bleepingcomputer.com/" type="rss" text="BleepingComputer - All Stories" title="BleepingComputer" xmlUrl="https://www.bleepingcomputer.com/feed/" />
      <outline htmlUrl="https://www.washingtonpost.com/business/technology/?itid=nb_technology" type="rss" text="Washington Post technology news." title="Washington Post - Technology" xmlUrl="https://feeds.washingtonpost.com/rss/business/technology?itid=lk_inline_manual_31" />
      <outline htmlUrl="https://www.nytimes.com/section/technology" type="rss" text="" title="NYT &gt; Technology" xmlUrl="https://rss.nytimes.com/services/xml/rss/nyt/Technology.xml" />
      <outline htmlUrl="https://www.npr.org/templates/story/story.php?storyId=1019" type="rss" text="Latest technology news and breakthroughs in technology, science, and industry. Download the NPR Technology podcast and Technology RSS feed." title="Technology : NPR" xmlUrl="https://feeds.npr.org/1019/rss.xml" />
    </outline>
    <outline text="Tech - Blogs">
      <outline htmlUrl="https://blog.thunderbird.net/" type="rss" text="News and Updates about Thunderbird" title="The Thunderbird Blog" xmlUrl="https://blog.thunderbird.net/feed/" />
      <outline htmlUrl="https://blog.mozilla.org/en/category/products/firefox/" type="rss" text="News and Updates about Mozilla Firefox" title="Firefox - The Mozilla Blog" xmlUrl="https://blog.mozilla.org/en/category/products/firefox/feed/" />
      <outline htmlUrl="https://discord.com/blog" type="rss" text="Learn about Discord's updates, insights, community stories, educational resources, and much more." title="Discord Blog" xmlUrl="https://discord.com/blog/rss.xml" />
      <outline htmlUrl="https://android-developers.googleblog.com/" type="rss" text="An Open Handset Alliance Project." title="Android Developers Blog" xmlUrl="https://feeds.feedburner.com/blogspot/hsDu" />
    </outline>
    <outline text="Gaming">
      <outline htmlUrl="https://www.minecraft.net/en-us/article" type="rss" text="All the latest news, inside info and insight into the community's amazing creations!" title="Minecraft.net - All Content RSS Feed" xmlUrl="https://www.minecraft.net/en-us/feeds/community-content/rss" />
      <outline htmlUrl="https://prismlauncher.org/news/" type="rss" text="An Open Source Minecraft launcher with the ability to manage multiple instances, accounts and mods. Focused on user freedom and free redistributability." title="Prism Launcher" xmlUrl="https://prismlauncher.org/feed/feed.xml" />
    </outline>
    <outline text="Health">
      <outline htmlUrl="https://www.npr.org/templates/story/story.php?storyId=1128" type="rss" text="Health" title="Health : NPR" xmlUrl="https://feeds.npr.org/1128/rss.xml" />
      <outline htmlUrl="https://www.nytimes.com/section/health" type="rss" text="" title="NYT &gt; Health" xmlUrl="https://www.nytimes.com/svc/collections/v1/publish/http://www.nytimes.com/section/health/rss.xml" />
      <outline htmlUrl="https://theconversation.com/us/health/articles.atom" type="rss" text="" title="Health – The Conversation" xmlUrl="https://theconversation.com/us/health/articles.atom" />
      <outline htmlUrl="https://www.webmd.com/" type="rss" text="WebMD Health - Trustworthy, Credible and Timely Health Information. The content of this feed is confidential and proprietary. It may not be distributed, copied or otherwise reproduced without express written permission from WebMD." title="WebMD Health" xmlUrl="https://rssfeeds.webmd.com/rss/rss.aspx?RSSSource=RSS_PUBLIC" />
    </outline>
    <outline text="Local">
      <outline htmlUrl="https://www.rochesterfirst.com" type="rss" text="" title="RochesterFirst" xmlUrl="https://www.rochesterfirst.com/app-feed" />
      <outline htmlUrl="https://www.democratandchronicle.com/news/" type="rss" text="Democratandchronicle - News" title="GANNETT Syndication Service" xmlUrl="https://feeds.feedblitz.com/democratandchronicle/news&amp;x=1" />
      <outline htmlUrl="https://www.roccitynews.com/" type="rss" text="Rochester news, arts, music, events listings and culture, on the web and in print every month. Offering alternative news for Rochester NY since 1971." title="CITY News. Arts. Life., CITY News - " xmlUrl="https://www.roccitynews.com/rochester/Rss.xml" />
      <outline htmlUrl="https://www.spectrumlocalnews.com/nys/rochester/news" type="rss" text="" title="Headlines | Rochester New York | Spectrum News 1" xmlUrl="https://spectrumlocalnews.com/services/contentfeed.nys%7crochester%7cnews.landing.rss" />
    </outline>
    <outline text="YouTube">
      <outline htmlUrl="https://www.youtube.com/channel/UCtMVHI3AJD4Qk4hcbZnI9ZQ" type="rss" text="" title="SomeOrdinaryGamers" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCtMVHI3AJD4Qk4hcbZnI9ZQ" />
      <outline htmlUrl="https://www.youtube.com/channel/UCXuqSBlHAE6Xw-yeJA0Tunw" type="rss" text="" title="Linus Tech Tips" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCXuqSBlHAE6Xw-yeJA0Tunw" />
      <outline htmlUrl="https://www.youtube.com/channel/UCq6VFHwMzcMXbuKyG7SQYIg" type="rss" text="" title="penguinz0" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCq6VFHwMzcMXbuKyG7SQYIg" />
      <outline htmlUrl="https://www.youtube.com/channel/UCkpKS8M7MaZAFewtUz24K3A" type="rss" text="" title="Cybershell" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCkpKS8M7MaZAFewtUz24K3A" />
      <outline htmlUrl="https://www.youtube.com/channel/UCjFaPUcJU1vwk193mnW_w1w" type="rss" text="" title="Modern Vintage Gamer" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCjFaPUcJU1vwk193mnW_w1w" />
      <outline htmlUrl="https://www.youtube.com/channel/UCK376qNDlNZZDNHsnaWuTeg" type="rss" text="" title="AntVenom" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCK376qNDlNZZDNHsnaWuTeg" />
      <outline htmlUrl="https://www.youtube.com/channel/UCcseEJAaGW5AwDyyNccQT_g" type="rss" text="" title="Joe is Hungry" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCcseEJAaGW5AwDyyNccQT_g" />
      <outline htmlUrl="https://www.youtube.com/channel/UC_yNp4SI3GUAWRbByVLf8Vw" type="rss" text="" title="bickuribox12" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UC_yNp4SI3GUAWRbByVLf8Vw" />
      <outline htmlUrl="https://www.youtube.com/channel/UCPcCzJ5G4tHG4PQRnZXc4Qw" type="rss" text="" title="ChaosX" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCPcCzJ5G4tHG4PQRnZXc4Qw" />
      <outline htmlUrl="https://www.youtube.com/channel/UCHccoKLjEnZ6NeXiIABDYdg" type="rss" text="" title="NETLORE" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCHccoKLjEnZ6NeXiIABDYdg" />
      <outline htmlUrl="https://www.youtube.com/channel/UCXoqL7S2DjbrJe5ewfmlDvw" type="rss" text="" title="slicedlime" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCXoqL7S2DjbrJe5ewfmlDvw" />
      <outline htmlUrl="https://www.youtube.com/channel/UCCOSYITWQHRSUxvlQ4_PSCg" type="rss" text="" title="Sonic the Hedgehog" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCCOSYITWQHRSUxvlQ4_PSCg" />
      <outline htmlUrl="https://www.youtube.com/channel/UCl2mFZoRqjw_ELax4Yisf6w" type="rss" text="" title="Louis Rossmann" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCl2mFZoRqjw_ELax4Yisf6w" />
    </outline>
  </body>
</opml>
mmkthecoolest commented 1 year ago

Imagine realizing that the reason this kept failing was that the actual OPML file was encoded with 'UTF-8 BOM' while the first XML tag used UTF-8. 🙃

I still think it should give clear error messages because the only way I found this out was running the app via Android Studio and checking the logs.

NobodyForNothing commented 3 months ago

I have a similar problem for my OPML file that is encoded in utf8. It is a normal feeder export.