Some pages show error when using browsers back button or revisiting inactive tab

AI-generated summary

A user reports a bug where navigating back to certain pages, such as the /admin/plugins or leaderboard sections, after an inactive tab refresh results in a 404 error. The issue occurs when returning via the browser’s back button after visiting the /logs page, but not when returning from other pages like /admin/badges. The user demonstrates the behavior with videos and console logs, showing that the page fails to load initially, though it becomes accessible after retrying. The problem appears specific to certain admin and leaderboard pages, suggesting a caching or session-related issue when revisiting inactive tabs.

Sometimes, when I return to a previously opened tab showcasing the leaderboard and the tab refreshes, I am taken to a 404 error page.

2 Likes

I see a similar behavior on my forum when I leave the /admin/plugins page open and revisit the tab later. The /admin/badges page, for example, works fine. So I connected my tablet to my computer to check the browser console. While waiting for the tab to become inactive again, I thought I could check /logs as well. And when I did that, I accidentally reproduced the bug on my computer:

  1. Visit /admin/plugins.
  2. Use the link in the admin sidebar to go to /logs.
  3. Use the back button of the browser to return to /admin/plugins.

Result:


and after you click “try again”, the plugins overview works again, but more errors appear in the console.

When you try the same with /admin/badges, it works as expected:

  1. Visit /admin/badges
  2. Use the link in the admin sidebar to go to /logs
  3. Use the back button of the browser to get back to /admin/badges

The above steps also work to reproduce the issue I noticed with the leaderboard. When I add /logs to the sidebar, visit a leaderboard, use the link to logs in the sidebar, and then use the browser’s back button to return to the leaderboard, Discourse says the leaderboard does not exist.

2 Likes