clragon / e1547

A sophisticated e621 browser
https://e1547.clynamic.net/
GNU General Public License v3.0
209 stars 16 forks source link

Post page duplication #68

Closed clragon closed 2 years ago

clragon commented 2 years ago

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.

clragon commented 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.

clragon commented 2 years ago

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.