Closed AaronMT closed 3 years ago
@AaronMT This seems to be fine again. I've published your test page here: https://csadilek.github.io/article.html and readability is detected right away. The test will need an update though as the reader toggle is now in the toolbar.
This still seems to be an issue. Perhaps there's some kind of lazy init going on with readability detection and a race with loading a page right at startup. The test-runner uses the mock web server to load a static asset page with the same HTML. On first load, I get no detection, if I manually refresh the page through the menu before the test fails I do get detection.
Tested on latest master (3351a028854d8db0b98ac4e8d469bb3d6117657d) on a Pixel 2 (hardware).
@AaronMT OK, I understand why I can only reproduce this in the test now. On first run with an empty profile, all built-in web extensions (including readerview) need to be installed. We do this lazily and async to not harm startup performance.
In the real app, the installed extensions persist so this doesn't need to happen on subsequent runs. In the test, it will happen on every run though. I don't think it's worth synchronizing this just for the very first app startup, given that I can't reproduce it loading a remote page, but I would like to solve this to unblock the test, at least. 🤔
Thanks @csadilek – I'll try this week to see if I can bypass this hurdle with refreshing the page or even loading the URL twice as a workaround. Do you think that might suffice?
@AaronMT Yes, that should suffice, thanks! I am still also looking into a way to prevent this workaround, but haven't found a good solution, so far.
The underlying race condition should be fixed now and I see readability being detected on first run in the tests.
Sounds good, thanks for the update. @sv-ohorvath we should try re-enabling reader tests.
👍 Just a heads-up that the tests will need some updates as the UI has changed a while ago. Reader mode button is now in the toolbar directly.
While attempting to re-enable Readability UI tests I stumbled upon a blocking issue of Readability detection not working on first visit.
This is the test HTML I am using (https://hg.mozilla.org/mozilla-central/file/tip/toolkit/components/reader/test/readerModeArticle.html).
Build (6317eea690f229d3f34ec540c64f475b3f164d29)
Launch the browser and visit the HTML above (e.g, htmlpasta). On first visit Readability fails to detect the page as reader capable. There is no blue dot on the menu, nor is there a reader toggle in the menu.
Close the tab or re-load or re-visit the same content and Readability is detected.
This currently blocks all Readability UI tests. This used to work fine and is a fairly recent (maybe a month or sooner) regression.
┆Issue is synchronized with this Jira Task