What the hell, NodeBB. That's not how pagination should work.
-
Okay, so now all of a sudden, I can't see any of the latest few replies in 🙅 THE BAD IDEAS THREAD:
That's with my pagination set to 5 posts/page.
When I change it to 50 posts per page... there are more:
I think I like this bug less than the "empty last page" bug... or even less than the apparently-related "last post on this page streamed in, but pagination thinks it should belong on the next page, so it doesn't display on this page or the next page when you go there, but when you come back to this page you'll finally see it" bug.
-
@anotherusername kinda sounds like the posts just didn't stream in, which reloading and or maybe leaving the topic and coming back to it fixes. For some definition of "fix..."
-
@anotherusername only noticed because @PleegWat mentioned me in the topic (not visible in the second screenshot, though), and at 5 posts per page it refused to display his post at all.
Although I could see the first few words of it in the topic list, as it was the most recent post in the topic at the time.
-
@Erufael said in What the hell, NodeBB. That's not how pagination should work.:
@anotherusername kinda sounds like the posts just didn't stream in, which reloading and or maybe leaving the topic and coming back to it fixes. For some definition of "fix..."
It didn't. That's the first thing I tried.
It's still broken, if I set my pagination to 5 posts / page:
Note that the highlighted post now says "about 12 hours ago" (in my first screenshot it said "about 11 hours ago"). And none of the later posts are showing up.
-
Even at 50 posts per page, it still refuses to acknowledge that there are more than 11616 posts, or set my read bookmark to the actual last post. Every time I enter the thread, the post I made 12 hours ago is highlighted, although there are two posts underneath it.
The tooltip in the topic list also says it has 11616 posts...
-
-
Great, now the trigger warning thread says there are 1046 posts, but refuses to show any past 1045 in any pagination.
-
Oye, @Erufael, do me a favor and go in one of those threads and tell me how many posts it says there are (and/or what's the last post in it).
edit: it's saying 11617 in the bad ideas thread now, as someone's posted. The count's still off by 2 (when I enter the thread, the 3rd from last post is highlighted and it won't update the bookmark past that post).
-
@anotherusername I don't think it's just you. It tells me there's 11617 posts, the bookmark is two posts up from the latest, and when I click the "go to end" arrows, it jumps me to that same post:
Zoomed out, but that's what happened after clicking the "go to end" arrows (and then scrolling down).
-
@ChaosTheEternal yeah, both the bad ideas and trigger warning threads have fucked up post counts (bad ideas is off by -2, trigger warning is off by +1).
-
@anotherusername Can't right now cuz on mobile without pagination. Once the internet people come and I get time, I'll do it on my laptop.
-
Yeah, NodeBB likes to eat up some posts now and then, just refresh.
Expecting to see all of a page's posts at all times is TRWTF. You might get this on some caveman technologies like phpBB, but we're not in the boonies here.
-
Counting is hard.
SELECT * FROM posts WHERE /* exclusion logic here */ deleted=0 limit (@posts_per_page * page), @post_per_page /* Except however the calculation actually goes */
Super hard.
-
@Lorne-Kates You expect Mongo to be able to do shit like that? You must be
-
@Lorne-Kates yeah, perhaps, but I haven't noticed this sort of thing before today.
-
It's not just paging - I'm still using infini-scroll. That's messed up too (as I posted in the bad-ideas thread)
-
@Lorne-Kates said in What the hell, NodeBB. That's not how pagination should work.:
Counting is hard.
Only for people who insist on using WEB SCALE TECHNOLOGIES! The web doesn't count things, it just presents an infiniscrolling stream…
-
@Lorne-Kates said in What the hell, NodeBB. That's not how pagination should work.:
/* exclusion logic here */
Read that as "delusion logic." Either I need more caffeine or I've been spending too much time in that thread.
Filed under: Or both. Yes, definitely both.
-
@abarker said in What the hell, NodeBB. That's not how pagination should work.:
@Lorne-Kates You expect Mongo to be able to do shit like that? You must be
No, I don't expect it to. But I enjoy pointing out how fucking simple it is in even the most stupidest of all non-Oracle SQL databases, just to shame them.
-
@Lorne-Kates fairly sure MSSQL can't do that, or if it can, it's pretty recent.
-
no
this is the forum software of the future
such is the price we pay for innovation
-
@bb36e then to the future, I say this "fuck you, give me sanity"
-
@dcon yeah, but at least with infiniscroll it loads the last 2 posts even though it doesn't count them.
-
@Arantor said in What the hell, NodeBB. That's not how pagination should work.:
@Lorne-Kates fairly sure MSSQL can't do that, or if it can, it's pretty recent.
WITH posts_page AS ( SELECT *, ROW_NUMBER() OVER (ORDER BY post_id) as post_index FROM posts WHERE /* exclusion logic here */ deleted = 0 ) SELECT * FROM posts_page WHERE post_index BETWEEN ((@page_size * (@page - 1)) + 1) AND (@page_size * @page);
BETWEEN goes back at least a decade, and ROW_NUMBER goes back to at least 2008, so it's been doable for a while.
-
@abarker I knew about ROW_NUMBER(), I was more on Lorne's 'even MSSQL can do it this retarded way' because it still doesn't have a
LIMIT start, limit
clause.Fun fact, I was once asked about porting one of the open source toxic hellstew packages to MSSQL. I learned.
-
@Arantor said in What the hell, NodeBB. That's not how pagination should work.:
@abarker I knew about ROW_NUMBER(), I was more on Lorne's 'even MSSQL can do it this retarded way' because it still doesn't have a
LIMIT start, limit
clause.Fun fact, I was once asked about porting one of the open source toxic hellstew packages to MSSQL. I learned.
You can set the rowcount for limiting the rows returned,
set rowcount @ReturnRows
Then in your query, for
start
where row_number > @StartAt
-
@Tsaukpaetra sure, you can do it, but the fact you have to jump through hoops to do it feels clunky and not in the spirit of Lorne's 'even dipshit RDBMSes can do this'
To be fair I don't blame MSSQL for this. It's designed for some value of Big Data in an OLAP workload and a forum is typically much closer to an OLTP workload.
-
@Arantor said in What the hell, NodeBB. That's not how pagination should work.:
@Tsaukpaetra sure, you can do it, but the fact you have to jump through hoops to do it feels clunky and not in the spirit of Lorne's 'even dipshit RDBMSes can do this'
Eh, it is what it is. Apparently MS though that you'd rather know upfront what your returned rows
limit
was, and if you wanted to skip some that's best left in theWHERE
clause.To be fair, it's not in the ANSI standard (to my knowledge), so it's an implementation detail, each DB does it differently so
-
@Lorne-Kates said in What the hell, NodeBB. That's not how pagination should work.:
Counting is hard.
Yes it is.
So, did @bb36e downvote me or what?
Edit: it was this post.
-
@Zecc said in What the hell, NodeBB. That's not how pagination should work.:
So, did @bb36e downvote me or what?
He might've un-upvoted. That produces a weird state.
-
-
@Zecc how weird. I wonder why that happened...
-
@Jaloopa said in What the hell, NodeBB. That's not how pagination should work.:
@Zecc how weird. I wonder why that happened...
Because counting is hard, weren't you paying attention? :P
-
@Zecc said in What the hell, NodeBB. That's not how pagination should work.:
So, did @bb36e downvote me or what?
No
-
@Jaloopa said in What the hell, NodeBB. That's not how pagination should work.:
@Zecc how weird. I wonder why that happened...
oh god, I just had a horrid thought...
Are they using an array to store the upvoters, and then taking the position the most recent notifier's name appears in the array as the number of upvotes, and if they un-upvoted, it's "not found" so position is -1?
-
@Yamikuronue pretty much...
See here: https://github.com/boomzillawtf/nodebb-plugin-upvote-notifications/blob/master/library.js#L108
I keep meaning to get back around to that...I didn't realize how downvoting worked when I wrote that.
-
@Arantor said in What the hell, NodeBB. That's not how pagination should work.:
Because counting is hard, weren't you paying attention? :P
3
-
@dkf said in What the hell, NodeBB. That's not how pagination should work.:
@Lorne-Kates said in What the hell, NodeBB. That's not how pagination should work.:
Counting is hard.
Only for people who insist on using WEB SCALE TECHNOLOGIES! The web doesn't count things, it just presents an infiniscrolling stream…
We had this "dynamic loading of new things" problem solved with Yahoo Chat in the 00's. Why it's gotten worse is beyond me.
-
@dkf said in What the hell, NodeBB. That's not how pagination should work.:
That produces a weird state.
California?
-
@HardwareGeek said in What the hell, NodeBB. That's not how pagination should work.:
California
Über alles!
-
@xaade said in What the hell, NodeBB. That's not how pagination should work.:
Why it's gotten worse is beyond me.
Because webscale! Because eventual consistency! Because Mongo!
...
Because