lemmy-ui
lemmy-ui copied to clipboard
Browser back from post always returns to first page of default configured sort
Requirements
- [X] This is a bug report, and if not, please post to https://lemmy.ml/c/lemmy_support instead.
- [X] Please check to see if this issue already exists.
- [X] It's a single bug. Do not report multiple bugs in one issue.
- [X] It's a frontend issue, not a backend issue; Otherwise please create an issue on the backend repo instead.
Summary
When scrolling through a feed, if you either are on page 2 (or later) or you sorted with a sorting method that's not the configured default of your account, if you click a post and then use browser-back to go back to the feed, the page shown will be the first and the sorting method will be your configured default. It still displays as if it was the other sorting method you originally browsed as well as the later page, but the posts will actually be from the first page of your default sort method.
Steps to Reproduce
- Configure "New" as default sort method
- Go to instance homepage, sort by "Old"
- Click a post
- Browser Back
- Displayed sort is still "Old", but posts are equal to the "New" feed
or
- Go to any feed
- Go to page 2
- Click a post
- Browser Back
- Page 2 will no longer be displayed, the posts will be page 1 posts.
Technical Details
Windows 10, Firefox 115.0b9
Lemmy Instance Version
UI: 0.18.1-rc.7, BE: 0.18.1-rc.4
Lemmy Instance URL
https://lemm.ee
Your second set of "steps to reproduce" gets me continually... This must not be a universal problem though I guess because it makes the site very difficult to use... Maybe it's worse on mobile where you are less likely to open new tabs.
Can confirm this happens on v0.18.2 as well on lemmy.dbzer0.com. Using Windows 11 and Firefox v115.0.2
It's very annoying.
Confirmed still occurring on BE: 0.18.4, Google Chrome.
A better title would be "When entering comments section on front page N+1, browser back always returns user to first page"
I am plagued by this problem too. However, depending on which page of the feed I'm on, I'm not always sent back to page 1. If I click on a post on page 3 and then press the browser back button, I will be sent to either page 2 or page 4. It seems pretty random. The URL in the browser's address bar correctly shows page 3, but the actual content is from page 2 or page 4.
BE 0.18.4, Firefox 116.0.3
I have this same issue on mobile (0.18.4). I've noticed that after hitting "back", the url in my browser is correct for what the page should be (although it's displaying results from the wrong page). If I paste it into a new tab, or refresh the page, I'm presented with the correct page of posts.
Not sure if this is a different issue, but if I navigate pages sequentially, my backwards navigation always takes me to the N-1th page.
Eg: Navigate 1, 2, 3, 4 Click a post on page 4 Navigate back I'm now seeing posts from page 3 Refresh page I'm now seeing posts from page 4
I'm seeing the "hitting back from comments for an item on page 2 always takes me to page 1" issue as well on lemm.ee, which is currently running v0.18.4.
I'm running Firefox 118.
Notably, the URL is correct for page 2 when I hit "back". In the most recent example, the browser's URL was https://lemm.ee/?dataType=Post&listingType=All&page=2&sort=Hot
, and I was seeing page 1 of the "All" view instead of page 2.
I am no longer experiencing this problem on servers that have upgraded to v0.19.0. I suspect it's related to the cursor-based pagination in pull request 3872.