You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project I have a chat detail with a list of messages. I use the RxTableViewSectionedAnimatedDataSource with two sections.
In most cases, only the section with the messages is shown but when the user scrolls to the top of the table view, I set the isLoading property so an additional section at the top is shown with just 1 cell showing a spinner.
The indexPath is for example section=1, row=6 but the _sectionModels only have 1 item, resulting in an out fo bound crash basically.
It looks like the data source is trying to update some item and still thinks the .LoaderSection exists (so .LoaderSection is section=0 and the update is for section=1) but the _sectionModels does not contain the .LoaderSection anymore.
The text was updated successfully, but these errors were encountered:
@RafaelPlantard, could you share what exactly was the issue on your end? I think I'm facing the same problem now with a similar use case like @igorkulman.
In my project I have a chat detail with a list of messages. I use the
RxTableViewSectionedAnimatedDataSource
with two sections.In most cases, only the section with the messages is shown but when the user scrolls to the top of the table view, I set the
isLoading
property so an additional section at the top is shown with just 1 cell showing a spinner.After loading the older messages is done
isLoading
is set back to false and the new messages appear inviewModel.messages
.This works fine most of the times, but when I scroll to top really fast doing it again and again I get a crash in https://github.com/RxSwiftCommunity/RxDataSources/blob/master/Sources/RxDataSources/TableViewSectionedDataSource.swift#L190.
When I do not append the
.LoaderSection
when constructingdata
then it does not happen, ever.To be more exact, in the method
The
indexPath
is for example section=1, row=6 but the_sectionModels
only have 1 item, resulting in an out fo bound crash basically.It looks like the data source is trying to update some item and still thinks the
.LoaderSection
exists (so.LoaderSection
is section=0 and the update is for section=1) but the_sectionModels
does not contain the.LoaderSection
anymore.The text was updated successfully, but these errors were encountered: