question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding Direct Feeds to Brave News makes the whole browser janky.

See original GitHub issue

Description

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

  1. Subscribe to a new direct feed from the new tab page. I’ve been using https://reactjs.org/. image
  2. Press the Add Feed button. Observe that the browser chrome is frozen while the feed is adding.
  3. 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:closed
  • Created a year ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
fallaciousreasoningcommented, Jul 17, 2022

Cheers, thanks @stephendonner!

1reaction
stephendonnercommented, Jul 16, 2022

Verified PASSED using

Brave 1.43.26 Chromium: 103.0.5060.114 (Official Build) nightly (x86_64)
Revision a1c2360c5b02a6d4d6ab33796ad8a268a6128226-refs/branch-heads/5060@{#1124}
OS macOS Version 13.0 (Build 22A5295i)

Steps:

  1. installed 1.43.26
  2. launched Brave
  3. opened a new-tab page
  4. clicked on Customize on the bottom right
  5. clicked on Brave News
  6. entered (one at a time)https://reactjs.org, https://planet.mozilla.org/rss10.xml, and https://planet.mozilla.org/rss20.xml
  7. confirmed I could add and remove each feed source without beach-balling/killing the main thread. No input / scrolling events were blocked

rss-feeds

Read more comments on GitHub >

github_iconTop Results From Across the Web

Brave News adds new features for customizing feeds, and ...
Today Brave News introduced integrated RSS subscriptions, locally personalized suggestions, new sources and content channels powered by ...
Read more >
Brave News now lets users add RSS feeds to customize their ...
Brave News now lets users add RSS feeds to customize their favorite content · In the browser Settings, the Brave News feature has...
Read more >
News Feed leaves out too many big websites, which can't ...
Brave News now allows you to add custom RSS feeds to be shown. Simply visit the news site you'd like to include and...
Read more >
Brave News
Brave News - customized news feeds, from leading sources, delivered right to your browser. All 100% private. Available on desktop, Android, and iOS....
Read more >
Google news feed in brave news - Mobile Support
Open it and select Brave News. Under “Your Sources” you find a text field and a button to add your own RSS feeds....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found