stacker.news icon indicating copy to clipboard operation
stacker.news copied to clipboard

Eliminate duplication that can happen after clicking More when ranking changes over time

Open cointastical opened this issue 3 years ago • 7 comments

After an initial load of the front page, an item might move from a position in the top 21 into a lower position before the More button is pressed. Then when More is pressed, that item likely will appear again in the newly added results.

A solution is to exclude from the results for pressing more any items that already appeared in the results above that existed before More was pressed.

cointastical avatar May 02 '22 07:05 cointastical

Do you have an example of this occurring? Afaik this shouldn't happen (I have a cursor), but I might've broken it at some point.

huumn avatar May 02 '22 13:05 huumn

What I had seen was when I pressed More, the item that was in position at 21 was then also showing in position 22 as well.

I don't know how long it was between when the page was first loaded, and when I pressed More. Might have been more than 10 minutes, maybe 30 minutes, I wasn't watching closely. A cursor is held over that long of a duration?

Or, perhaps this is an off-by-one bug (since this occurred at the end of the set)?

cointastical avatar May 03 '22 08:05 cointastical

A cursor is held client side so shouldn't be affected by the time you come back.

The cursor encodes the time the page's query was loaded. All pages (ie more) are scoped to the time the page is loaded - new items/votes shouldn't be considered.

Again, there might be a bug in the implementation.

huumn avatar May 04 '22 20:05 huumn

Now that we've denormalized ranking scores, this is not going to be possible (if ranking changes there's no way to use ranking at time of page load) but IMO not a huge deal. Closing to clear up issues. We can re-open if this gets bad.

huumn avatar May 18 '22 18:05 huumn

Now it has two rows at 21.

Screenshot at 2022-07-13 07-35-57

cointastical avatar Jul 13 '22 12:07 cointastical

Yeah I also noticed this occasionally and recently

ekzyis avatar May 19 '23 22:05 ekzyis

The only way to really eliminate this given the way we rank (denormalized values) is expanding the cursor to encode the items in the list that we already have, so that we can explicitly exclude them on the next page.

huumn avatar May 19 '23 22:05 huumn