That's likely because you are asking the api for a paginated list of posts/comments. When you request page 1 at one point and page 2 at a later time, the list of posts can change inbetween, so posts that were part of page 1 have now been pushed down into page to, so you get them again when loading page 2. The solution is to keep a list of post ids that are already in your list of posts and don't load those again, same with comments.
this post was submitted on 23 Jun 2023
1 points (100.0% liked)
Lemmy App Development
732 readers
1 users here now
A place for Lemmy builders to chat about building apps, clients, tools and bots for the Lemmy platform.
On-Topic:
- programming questions related to the Lemmy platform
- sharing your ideas, WIP, or released Lemmy-related work
Off-Topic:
- general programming questions unrelated to Lemmy
- feature requests for developers
- sharing or promoting work not related to Lemmy
founded 2 years ago
MODERATORS
Ah smart. I fixed the issue by sorting out duplicate post ids before displaying my list of posts
That's exactly what I meant to say ;-)