companyzero / bisonrelay

ISC License
31 stars 13 forks source link

bruig: Messages being rebuilt repeatedly #336

Closed alexlyp closed 1 year ago

alexlyp commented 1 year ago

While working on adding a new feature, I noticed that Messages (and all the events beneath) is being called repeatedly, with no interaction with the GUI. Simply sitting will cause it to rebuild it approx. 1-2 times a second. There is probably an issue in the widget update or debounce there.

alexlyp commented 1 year ago

After investigating, it appears that the itemsPositionListener is being called repeated, even when just sitting and no scrolling is occurring. We should look to see if there is a way restrict the number of calls here. And to also restrict was is causing rebuilds for Messages.

alexlyp commented 1 year ago

https://github.com/companyzero/bisonrelay/blob/master/bruig/flutterui/bruig/lib/components/chat/messages.dart#L47-L71