Wedge

Public area => Bug reports => The Pub => Archived fixes => Topic started by: Arantor on January 19th, 2013, 02:37 AM

Title: Previous/next topics don't work properly
Post by: Arantor on January 19th, 2013, 02:37 AM
The query logic is actually very broken - but it's taken me this long to notice it. Part of the problem is understanding what desired behaviour is and what we actually get.

Against a board of non pinned posts, there's no problem, and there's never been a problem. But when you cross the pinned barrier, it all goes to hell.

For example, 'When can I download Wedge?' is the most replied to pinned topic in /pub/, last reply Jan 12th.

The 'next' topic is the one next chronologically on from it, which is about half way down the board, while the 'previous' topic is quite rightly the previous sticky topic.

Now I pick an unpinned topic from earlier. The 'next' topic is correct, but the 'previous' topic is the pinned topic that happens to be the most recent one prior to the date of the topic in question, if that makes sense (I picked a post from mid December, which pre-dates When can I download Wedge's last reply, but is after Read This First's last reply)

And this is even before I apply non-1 values to is_pinned >_<
Posted: January 19th, 2013, 02:32 AM

It sort of depends on what the behaviour should be, I'm guessing when you reach the most recent topic in a given board that is non pinned, the next one *should* be the oldest/bottom-most pinned topic?

As in, previous/next are effectively traversal up the message index as presented?
Title: Re: Previous/next topics don't work properly
Post by: Arantor on January 19th, 2013, 02:53 AM
OK, just to really confuse matters, my terminology is wrong. The left link is actually 'previous', not next, and the right link is actually 'next' in the code terms. At least I know which query does which now...
Title: Re: Previous/next topics don't work properly
Post by: Arantor on January 19th, 2013, 04:31 AM
OK, I think I fixed this and will commit in my next commit. I think I was the one who broke this originally, years ago :o
Title: Re: Previous/next topics don't work properly
Post by: Nao on January 20th, 2013, 04:09 PM
I think I'm the one who rewrote the Previous/Next feature a year ago or so. Was very proud of it. I also think that it took pinned topics into accounts...
Where exactly do you think you'd broken it...? I haven't looked at your latest commits yet.
Title: Re: Previous/next topics don't work properly
Post by: Arantor on January 20th, 2013, 04:25 PM
I seem to recall being the one who wrote the fun and exciting UNION query that fetched things, and it wasn't respecting pinned topics properly, but the latest commit should show it as fixed now.
Title: Re: Previous/next topics don't work properly
Post by: Nao on January 25th, 2013, 03:32 PM
Ah yes, I'm not good enough with MySQL that I could have thought of the UNION trick, so that was definitely yours ;)


Gosh I didn't realize we had so many bugs to fix... It seems like I'm only working on fixing stuff, these days!
Title: Re: Previous/next topics don't work properly
Post by: Arantor on January 25th, 2013, 03:38 PM
Yeah, that's because we've implemented a lot of the fun stuff and bug fixing is the bit no-one likes doing.
Title: Re: Previous/next topics don't work properly
Post by: Nao on January 25th, 2013, 04:12 PM
Oh, bug fixing is fun once you're done... :P It can be rewarding. I know I was really glad I managed to spot the AeMe bug yesterday. It "only" took me a couple of hours...

What's NOT fun at all is building everything around Wedge: documentation mostly, and server stuff. I'm not really looking forward to this one... If I ever do it, actually!
Title: Re: Previous/next topics don't work properly
Post by: Arantor on January 25th, 2013, 04:42 PM
The plugin server is firmly in my domain ;)
Title: Re: Previous/next topics don't work properly
Post by: Nao on January 25th, 2013, 07:00 PM
Sure, but there's also the update server to deal with... (If we do.)
Title: Re: Previous/next topics don't work properly
Post by: Arantor on January 25th, 2013, 08:34 PM
The plugin server and the update process have common code elements. And it's why I'm so adamant about them being separate physical servers, to cope with the heavy load they're going to get.

But the plugin server is actually a higher priority for me to get running - I actually have no qualms about deferring an 'upgrade' process until we're nearer actually needing it, and honestly I have no problem with the first update or two being manually pushed out until we're in a position to do automated push updates.