'Top' sorting always defaults to Year time period

I’m not sure if this is a bug, but whenever I visit /Top, the time period selected by default is always the past year. From what I have read on Meta, it should select the time period based on your last visit - i.e. if you haven’t visited Meta in a few days, it shows the past week; likewise, if you visited it yesterday, you should be shown the Top posts for the past 24 hours.

2 Likes

Possibly but I am not sure we did this on manual navigation to top, it is more of a redirect for long absent users. Perhaps @zogstrip can advise.

2 Likes

Turns out, this was broken since we added support for a default top timeframe. That value was overriding the date of the user’s previous visit instead of just being a default value when there was no previous visit (new user or anon).

https://github.com/discourse/discourse/commit/33bc8c276d8db36513adf72a863db3d648613489

While at it, I noticed another bug where a returning user would not be redirected to the proper timeframe due to a variable not being named properly on the client-side… :man_facepalming:

https://github.com/discourse/discourse/commit/b792db9d92dedd5bcd9386f4169fb6c4ee1b55aa

Thanks @P16 for the report as we got to fix 2 bugs :raised_hands:

3 Likes

Thanks @zogstrip for fixing this! Just to confirm, is the correct behavior to default to the most relevant time period, even if /top is selected manually?

While on this topic, are you still open to suggestions for the Top sorting criteria, as the original topic has closed:

Yes, that is correct.

Sure, I’ve re-opened the topic.

1 Like

This topic was automatically closed after 7 hours. New replies are no longer allowed.