Closed clarkwinkelmann closed 7 years ago
@clarkwinkelmann first, could you create an issue on @flarum/core? Feel free to relate back to this PR.
I will review the implementation today and merge if ok. Thanks for the investigation it's good to see you ran into exactly the same issues I had 😄
After many trials and errors on the trail of @Luceos, I managed to find a solution that satisfies most (all ?) of the problems we had:
The following solutions were tested without success:
PostStream.posts()
Discussion.postIds()
It looks like something is reordering the posts after the Mithril object is returned from
PostStream.views()
, probably based on the content ofdata-index
,data-number
ordata-id
. Given the wayPostStream
gives these numbers out there is no way to push an item with a valid, yet non-duplicated value of index/number/id without forcing to change all the numbers from all posts until the end of the discussion.The current solution also works if we push ads items directly in the stream (they don't get reordered randomly). However, this breaks the
PostStreamScrubber
.