Fix error of Wikipedia entering in an infinite recursion of page loading
ClosedPublic

Authored by pgomes on Feb 13 2020, 2:40 PM.

Details

Summary

Wikipedia applet enters in the following loop when loading any article:

  1. WikipediaEngine loads article from Wikipedia and formats it
  2. communicate page is ready to QML with PageChanged signal
  3. QML script loads html via content.loadHtml; this triggers a naviagateRequest signal
  4. same QML script captures the signal, and evokes WikipediaEngine.setUrl (passing a data-scheme URL), restarting the loop

The patch does the following

  • fix the loop by only handling naviagateRequest signals that were caused by clicking in a link (LinkClickedNavigation). The one that was causing the issue (signaled by loadHtml) is TypedNavigation
  • click to reload button invokes WikipediaEngine.reloadWikipedia(); before it was only reloading the data-schemed URL that was being displayed
  • remove the deprecated "srredirects" parameter from the GET query

Diff Detail

Repository
R181 Amarok
Lint
Lint Skipped
Unit
Unit Tests Skipped
pgomes created this revision.Feb 13 2020, 2:40 PM
pgomes created this object with edit policy "Administrators".
Restricted Application removed a project: Amarok. · View Herald TranscriptFeb 13 2020, 2:40 PM
Restricted Application added subscribers: amarok-devel, Amarok. · View Herald Transcript
pgomes requested review of this revision.Feb 13 2020, 2:40 PM
Restricted Application removed a project: Amarok. · View Herald TranscriptFeb 14 2020, 10:05 AM
Restricted Application removed a project: Amarok. · View Herald TranscriptFeb 14 2020, 10:06 AM
Restricted Application removed a project: Amarok. · View Herald TranscriptFeb 14 2020, 10:06 AM
pgomes edited the summary of this revision. (Show Details)Feb 17 2020, 10:35 AM
pgomes edited the summary of this revision. (Show Details)
heikobecker added inline comments.
src/context/applets/wikipedia/plugin/WikipediaEngine.cpp
496

Any reason we need to keep this as a comment?

pgomes updated this revision to Diff 76299.Feb 24 2020, 2:40 PM

Editted patch to remove line that was commented out

This revision was not accepted when it landed; it landed in state Needs Review.Feb 25 2020, 10:08 PM
This revision was automatically updated to reflect the committed changes.