Adding Direct Feeds to Brave News makes the whole browser janky.
See original GitHub issueDescription
If you add a direct feed to Brave News, the whole browser will lag/freeze when subscribing/unsubscribing from a feed. As best I can tell, this is because the BraveNewsController is fetching the feed on the UI thread, so the main thread is blocked while it downloads the latest info.
It doesn’t seem to be a problem for the default publishers as it is much faster (0.2s vs 3.5s), so it might be that we’re still blocking the UI thread, it’s just not as bad.
My best guess is that the SimpleURLLoaders used by brave/components/api_request_helper/api_request_helper.h
are running on the main thread. The feed/sources download is retriggered whenever a feed is modified.
In the meantime, there is a simple fix for the jank - just remove all direct feeds, however, this is obviously not ideal.
Steps to Reproduce
- Subscribe to a new direct feed from the new tab page. I’ve been using
https://reactjs.org/
. - Press the
Add Feed
button. Observe that the browser chrome is frozen while the feed is adding. - Now you are subscribed to the direct feed all of the following actions will trigger a freeze:
- Refreshing the feed
- Unsubscribing from a publisher
- Subscribing to a publisher
- Opening the new tab page for the first time in a window (this is when BraveNews loads the initial list of publishers/feeds).
- Any other call to
PublishersController::EnsurePublishersIsUpdating
Actual result:
Interacting with Brave News causes small freezes of about 3s with each refresh/subscribe/unsubscribe.
Expected result:
Interacting with Brave News does not cause the Browser UI to freeze.
Reproduces how often:
Every time. Tested in Dev, Nightly, Beta
Brave version (brave://version info)
1.41.86 Chromium: 103.0.5060.66 (Official Build) beta (64-bit) 1.43.3 Chromium: 103.0.5060.114 (Official Build) nightly (64-bit) 1.43.2 Chromium: 103.0.5060.114 (Developer Build) (64-bit)
Version/Channel Information:
- Can you reproduce this issue with the current release? Not tested, but probably
- Can you reproduce this issue with the beta channel? Yes
- Can you reproduce this issue with the nightly channel? Yes
Other Additional Information:
- Is the issue reproducible on the latest version of Chrome? No. This is a Brave only issue.
Miscellaneous Information:
You can remove all direct feeds, which will minimise the issue. However, I believe there’s still jank, it’s just smaller/less noticeable. In addition, I would expect this to be much, much worse with a bad internet connection as the jank is while waiting for a network response.
Screencast from 07-07-22 11:14:22.webm Note: In the screencast you can’t see my mouse but I’m clicking back and forward on the tab buttons, which is why the OS throws up the “Application is not responding” dialog. It doesn’t normally do this. You can see that once I remove the direct feed I can swap back and forward normally.
Issue Analytics
- State:
- Created a year ago
- Comments:10
Top GitHub Comments
Cheers, thanks @stephendonner!
Verified
PASSED
usingSteps:
1.43.26
Customize
on the bottom rightBrave News
https://reactjs.org
,https://planet.mozilla.org/rss10.xml
, andhttps://planet.mozilla.org/rss20.xml