Firebase pagination not working when fetching posts from different users
Clash Royale CLAN TAG #URR8PPP Firebase pagination not working when fetching posts from different users I am trying to paginate data from firebase with a query based on "creationDate" and my code works when I am not following anyone, but as soon as I follow someone with a different uid, the main feed begins to duplicate posts and not order them correctly. Here's what a snapshot of the data I am fetching looks like: The snapshot key is the key of the post that is later fetched and the child of this snapshot holds references to the poster's UID, as well as the creationDate of the post, which is used to order the query. The code for fetching the data is below: static func loadPosts(posts: [Postt], isFinishedPaging: Bool, completion: @escaping ([Postt], Bool) -> Void) { guard let uid = Auth.auth().currentUser?.uid else {return} var pagingTemp = isFinishedPaging let ref = Database.database().reference().child("feed").child(uid) var query = ref...