Ashinch / ReadYou

An Android RSS reader presented in Material You style.
GNU General Public License v3.0
4.84k stars 188 forks source link

The FlowPage is constantly being recomposed #622

Closed lazzzis closed 7 months ago

lazzzis commented 7 months ago

1. Environment

Latest build

2. Describe the bug

Add this log Log.i("RLog", "ArticleItem: recomposition ${articleWithFeed.article.title}") to ArticleItems.kt https://github.com/Ashinch/ReadYou/blob/4c7bea918d3c0799c4105b8d00cd9f3fbc008fc1/app/src/main/java/me/ash/reader/ui/page/home/flow/ArticleItem.kt#L78-L84

Build, launch and navigate to FlowPage.

In the logcat, I am seeing the ArticleItem is endlessly being recomposed.


I am sure this bug is introduced in commit #594, since this issue is not observed on the build based on its previous commit.

The debugger says these two values are changed during every recomposition

https://github.com/Ashinch/ReadYou/blob/4c7bea918d3c0799c4105b8d00cd9f3fbc008fc1/app/src/main/java/me/ash/reader/ui/page/home/flow/FlowPage.kt#L102-L112

If I hardcoded these two variables to null, this issue is not observed.

I don't understand why these two values are keeping changing. But I guess they are the root causes which make the flow page a little sluggish.

JunkFood02 commented 7 months ago

Thanks!