Closed clragon closed 2 years ago
this issue could be partially mitigated when using freezed to generate models and calling toSet
on the resulting items.
however, as of right now, engaging this doesnt work well in the code because adding a new page doesnt trigger an overall filtering, only a new page filtering, which does not remove duplicates.
we will not further pursue fixing this issue for now. perhaps we will fork the infinite scroll pagination package at some point to introduce controlled data fetching, which would make it easier to handle this problem.
It is possible for post duplication to happen due to behaviour in
infinite_scroll_pagination
.The PagedLayout can request the same page multiple times in a row, or alternatively if multiple PagedLayouts are connected to the same PaginationController and a refresh is called, the first page will be requested n times, where n is the amount of Layouts connected.
It might be possible to prevent this by combining a mutex lock and a strict control on which page key is currently being requested, then denying incoming requests with the same key.