Browser Back -function occasionally broken on Android

I can’t yet put my finger on this issue, or have no idea of the root cause, but as this breaks basic browser functionality I had to report early.

Recently, during the last week or so, a new issue has emerged on our CDCK SaaS instance Tappara.co.

Occasionally the browser Back button does not take you back to the index page where you came from, but to another topic you were reading before that.

I personally see this often and several users have reported the same issue. So far all reports from Android/Chrome users.

3 Likes

Hi @ljpp - thanks for reporting this. There have been some recent upgrades in the code which handles our ‘back’ navigation, so it’s certainly possible there’s been a regression, or an incompatibility with a theme/plugin on your site.

Do you have a specific sequence of page visits which will trigger the issue?

1 Like

No repro-pattern yet, but it happens frequently. Also some other odd ball behavior has been seen during the last couple of days, which could be related.

  • Browser refresh took me to a different page than were I was when executing the refresh.
  • I have seen Topics not opening when when tapped on index page.
1 Like

This is happening for me at the moment. I noticed that when I use the back button the topic jumps to a different post in that topic and afterwards latest appear again. Then I cannot open the topic again. After refreshing the topic is there.
Note the back button also does not take me back to latest at the end. I visited that topic more than once before, because it is somehow triggering the issue (Maybe the link to a different post of the topic or even the “show full post” button of the first post, I still don’t have clear steps)

I tried to reproduce some more. I definitly happens when the back button does not directly take you back to lastest and there is this jump to another post before you are taken back to the topic list

3 Likes

This happends on iPad/DiscourseHub too when swiping from left. Started actually yesterday and here. Quite annoying :smirk:

And it doesn’t do it constantly. Sometimes it shows a second earlier topic, reload forum and goes nicely back to home. Or it starts go through history of red topics.

Sure — this can be different issue, but because it sounds same I didn’t start a new topic.

3 Likes

Thanks all - we’ll keep digging into possible causes. If anyone is able to check their browser console for errors when this happens, that would be very helpful (I realise that’s easier said than done on mobile!)

2 Likes

I opened a topic from latest, used the back button to get back to latest and clicked the topic again. It does not open. This is the error I get

Uncaught TypeError: Cannot read properties of undefined (reading 'refresh')
    at e.navigatedToPost (url.js:335:20)
    at e.routeTo (url.js:240:14)
    at e.E [as navigateToTopic] (topic-list-item.js:44:16)
    at e.click (topic-list-item.js:284:19)
    at e.trigger (core_view.js:63:1)
    at e.r [as trigger] (index.js:383:1)
    at e.trigger (ember-events.js:138:30)
    at e.r [as trigger] (index.js:383:1)
    at HTMLTableRowElement.o (ember-events.js:203:39)
navigatedToPost @ url.js:335
routeTo @ url.js:240
E @ topic-list-item.js:44
click @ topic-list-item.js:284
trigger @ core_view.js:63
r @ index.js:383
trigger @ ember-events.js:138
r @ index.js:383
o @ ember-events.js:203
5 Likes

But somehow the same can happen without any error:


And then the back button also does not take me back to latest

There are no errors when the back button does not take you back to latest

5 Likes

Thanks for the detailed info @Moin. I just merged a commit which should take care of the problem. It’ll be live on Meta within the next 30-60 mins.

5 Likes

After short session now it looks like my iPad started acting normally too. So it wasn’t only issue of androids?

2 Likes

Yeah, I don’t think it was Android-specific.

The problem was somewhat dependent on network/cpu performance, so that might explain why it was noticed more frequently on tablets. But the problem was also reproducible for me on macOS chrome after slowing down network/cpu in the dev tools.

2 Likes

If the fix did not regress anything here at Meta, could you deploy to Tappara.co as well?

2 Likes

It looks like there is an outstanding issue when the ‘loading indicator’ site setting is configured to the (non-default) ‘spinner’ setting. We’ll get that fixed up ASAP.

2 Likes

That ‘loading indicator = spinner’ issue will be resolved by FIX: Ensure topic route does not replaceState after navigation (#24563) · discourse/discourse@86f3e86 · GitHub

2 Likes

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