https://bugs.kde.org/show_bug.cgi?id=525711

            Bug ID: 525711
           Summary: Changing the URL of an existing feed causes various
                    breakages
    Classification: Applications
           Product: akregator
      Version First 6.7.3
       Reported In:
          Platform: Gentoo Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

STEPS TO REPRODUCE
1. Have a pre-existing feed in Akregator.
2. Edit the feed and change the URL to a different website with different
content.
3. Refresh the feed so the new articles are fetched and displayed.
4. The new articles cannot be viewed, marked as read, or interacted with in any
way. The right-click menu is all grayed out.
5. After restarting Akregator the new articles can be interacted with but all
old articles from the previous URL are gone.

I'm far from an expert at reading C++ code, but here is what I've found:

URLs are used as unique identifiers for feeds. The FeedList class keeps a
url-to-feed map in urlMap. Editing the URL of a pre-existing feed in the feed
properties dialog calls Feed::setXmlUrl but that only updates the URL
internally in the Feed class. It does not update the urlMap in FeedList. This
means that every call to FeedList::findByURL for the new URL will return a null
pointer. This happens in many places in the code.

The reason the new articles cannot be viewed is because of this call chain:
#0 Akregator::FeedList::findByURL(QString const&)
#1 Akregator::FeedList::findArticle src/feed/feedlist.cpp:320
#2 (anonymous namespace)::articleForIndex src/selectioncontroller.cpp:38
#3 Akregator::SelectionController::currentArticle
src/selectioncontroller.cpp:140
#4 Akregator::SelectionController::articleSelectionChanged
src/selectioncontroller.cpp:314
FeedList::findByURL fails and articleSelectionChanged gets an empty Article()
and then shows nothing in the internal viewer.

New articles cannot be marked as read because ArticleModifyJob::doStart uses
FeedList::findByURL and will silently do nothing if the article is null.

New articles cannot be deleted because ArticleDeleteJob::doStart uses
FeedList::findByURL and will silently do nothing if the article is null.

Restarting Akregator will repopulate that urlMap in FeedList and fix the
breakage.

There is another problem because URLs are also used as identifiers for feeds
when archived on disk. Changing a URL at runtime will not migrate the old
articles to the new on-disk archive, so articles of the previous URL are gone
on the next restart.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to