Nodebb: Infinite scroll posts stream too soon

Created on 8 Nov 2016  路  10Comments  路  Source: NodeBB/NodeBB

Please include the following information when submitting a bug report/issue:

  • v1.2.1 1c4effbdf8398a67999cd00a580d596374d196fc
  • Mongo 3.2.10
  • Exact steps to cause this issue

    1. Be reading a long and active topic using infiniscroll and "don't scroll to my post" where the last post isn't loaded

    2. Read posts, scroll down, reply more, etc...

  • What you expected

    • Posts stream onto my page in the correct chronological order

  • What happened instead

    • New posts streamed in before older posts.

It seems like when a new reply in the topic happens the post gets streamed in regardless of where the user is currently reading. This causes a lot of confusion and missed posts.

enhancement

Most helpful comment

Seems like we shouldn't add a new post with index N to the dom if the post with index N-1 isn't loaded 馃

All 10 comments

Don't forget how your own post will persist in the page somewhere arbitrarily. That's weird too.

Hi @boomzillawtf -- I can't reproduce this on a development environment...

  • I have a topic with 20 posts, and I load it with account _A_ (which has pagination set to 5). 5 posts load (plus OP).
  • Account _B_ (in an incognito window) replies to the topic
  • Back in account _A_'s window, no new post is added. If you scroll down and trigger infinite load a couple times (to get to the bottom), the new post from _B_ is at the end

Do you have a more specific set of reproduction steps?

Did some debugging -- as it turns out, the new post is streamed in immediately and added to the DOM, but when the infinite scroller queries and adds new posts, they are correctly inserted _before_ the new reply, preserving the order.

Keep in mind I tested this with the "oldest to newest" sort, it is conceivable that your sort setting is different?

Not really, though the topics are a lot bigger than that and typically there are several people posting.

I am definitely using oldest to newest. I may be dozens (or hundreds!) of posts from the end of the thread. It seems like the new post shouldn't be added at all if the post that would display before it hasn't been loaded yet.

I tried to figure out how posts got updated on the page after someone replied, but I couldn't figure out how that all happens.

You're right, we shouldn't be adding the post immediately if the event is received, but even though that is the case, the post rendering logic is _still_ supposed to properly detect the order and adjust. So that's the real bug, and unless there's a reason to have the post stream in immediately, that should be removed too (or proper topic detection added), but that's icing on the cake.

Keep in mind that if the last post in a topic is streamed in but the 5000 posts before that aren't, clicking the "go to end" button puts you at the bottom of the currently loaded posts.

We experience this issue all the time over on Mangolassi.it when a thread is super busy. I thought we had a post about it over there, let me see if I can find that.

Edit: could not find a thread about it, so it must be part of another thread and search is a pain.

Keep in mind that if the last post in a topic is streamed in but the 5000 posts before that aren't, clicking the "go to end" button puts you at the bottom of the currently loaded posts.

I'm just here to bump this issue because this effect has been hitting me a lot lately.

Adding my voice. https://mangolassi.it/ sees this pretty often probably due to the volume that we handle. We have single threads with 35,000 posts and 9M views so the system is working pretty hard. Trying to just scroll through the post on infinite scroll causes it to show posts broken up and messed up pretty badly.

Seems like we shouldn't add a new post with index N to the dom if the post with index N-1 isn't loaded 馃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

darKnight0037 picture darKnight0037  路  4Comments

antoine-pous picture antoine-pous  路  3Comments

aStonedPenguin picture aStonedPenguin  路  4Comments

BenLubar picture BenLubar  路  3Comments

FaizanZahid picture FaizanZahid  路  4Comments