flarum / issue-archive

0 stars 0 forks source link

Temporary duplicate post #230

Open zerosonesfun opened 5 years ago

zerosonesfun commented 5 years ago

Bug Report

Current Behavior Every now and then, after using the more posts pagination button, you will see a duplicate post. It has been happening for a long time. Probably since at least the last few releases. But, since it is rare it is hard to get an example. I finally got an example this morning. I have a theory which might be worth looking into. This duplicate post was a new extension post on discuss.flarum which means it had to be approved. Maybe this is an issue with posts that have to be approved?

Steps to Reproduce

  1. Create a post using a tag that requires approval.
  2. Approve post.
  3. Create other posts until this approved post is at the bottom just above the more posts button.
  4. Click the more posts button. Is there a duplicate? If no, then my theory is wrong, but, the fact is this happens from time to time. 🤷🏼‍♂️

Expected Behavior There should never be duplicate posts. Even if only temporary.

Screenshots

3-E2-B030-B-FF63-4431-B639-9-EC1-E2-DFD99-B

Environment

franzliedke commented 4 years ago

I would be happy if someone could try to reproduce this. Currently, the "Steps to Reproduce" are only based on a theory. :wink:

Now that we have our demo site, this could be tried there.

matteocontrini commented 4 years ago

I think it's because the XHR request loads more posts based on an offset, so if in the meantime a new discussion appeared at the top, the last one(s) of the list could be loaded twice (in the same way, if a discussion was deleted, some items could be missing when clicking the "more" button).

dsevillamartin commented 4 years ago

This might just have to do with the pagination currently being quite broken. https://github.com/flarum/core/pull/1829 might fix this if it is still an issue.

franzliedke commented 4 years ago

@matteocontrini That would have been my assumption, too. But we need to make sure that's the case.