Unable to go back to a previous page from account page

AI-generated summary

The issue of being unable to go back to a previous page from the account page has been reported and reproduced by multiple users. The problem occurs when navigating from /my/preferences to the account page and then trying to go back. It has been identified that the issue arises because the URL https://meta.discourse.org/u/user/preferences/ is added to the browser’s history, causing the back button to fail.

lucasbasquerotto suggests that the fix could be to prevent https://meta.discourse.org/u/user/preferences/ from being added to the browser’s history. eviltrout has implemented a fix and committed it to GitHub, which appears to resolve the issue in all tested cases. The bug is believed to have been present since at least the last Ember upgrade.

Hi, the following is happening for me.

  1. Click on link to /my/preferences
  2. Click on browser’s back button

Nothing happens

Would love this to be fixed!

I can reproduce this on Meta! Thanks for reporting :slight_smile:

https://meta.discourse.org/my/preferences

6 Likes

Hmm is this a new regression @sam or something we need to backport?

2 Likes

Pretty sure there have been issues here for many years, last time I recall @eviltrout investigating this, can you have a look Robin?

4 Likes

This seems to happen because Discourse Meta - The Official Support Forum for Discourse actually goes to https://meta.discourse.org/u/user/preferences/ and then to https://meta.discourse.org/u/user/preferences/account.

You can see in the go back history the initial page and the https://meta.discourse.org/u/user/preferences/ page.

If you go directly to https://meta.discourse.org/u/user/preferences/account the error doesn’t happen.

To fix it I think the url https://meta.discourse.org/u/user/preferences/ shouldn’t go to history when you access (only https://meta.discourse.org/u/user/preferences/account).

This doesn’t happen when paste the url the browser.

In my case:

The problem happens: https://meta.discourse.org/u/lucasbasquerotto/preferences/

The problem doesn’t happen: https://meta.discourse.org/u/lucasbasquerotto/preferences/account/

4 Likes

This is another manifestation of a bug that has long plagued us. I believe this fix should last for a while, as it worked in all the cases I tried:

https://github.com/discourse/discourse/commit/02f6db4e59e03f49739be7e228641613dab0ae26

(the commit message has more detail.)

I suspect this has been here since our last Ember upgrade at least. Probably longer.

10 Likes