Infinite-Fire icon indicating copy to clipboard operation
Infinite-Fire copied to clipboard

Loading more messes with movement of items

Open Jogga opened this issue 9 years ago • 2 comments

I have an InfiniteFireArray with the following query: ref.orderByChild("createdAt"). The value of createdAt is set via timestamp. This causes an item, created by the client, to be added, then moved.

My RecyclerView's OnScrollListener's onScroll Callback will be called most of the time when a item gets added. This often results in a array.more() call.

Here's the issue: array.more() interferes with the movement of a added item: previousChild, needed for the correct movement becomes null. This causes the items to be moved to wrong positions. Consequential errors like duplicate items may occur.

Jogga avatar Feb 19 '16 18:02 Jogga

Am facing a similar problem. Has this been solved?

atimothee avatar Jan 11 '17 15:01 atimothee

The problem was caused by wrong previousChild values. As far as I remember I did not manage to find a solution for the movement/sorting but tried to at least prevent duplicates with #4

Can you post more details about the problem you're dealing with? (If you find a solution, PRs are always welcome!)

marcorei avatar Jan 12 '17 10:01 marcorei