Core: Bug after click to browser's back button or Flarum logo

Created on 3 Jul 2018  路  5Comments  路  Source: flarum/core

Bug Report

Current Behavior
After some attempts clicking the browser's back button or the Flarum logo while in an article, the back button will stay at the top left and the article title will stay as the tab title.

Here is a video I captured:
https://youtu.be/VjUpZh6Sy60

Steps to Reproduce

  1. Go to Flarum's home page
  2. Click on a topic
  3. Click on your browser's back button or the Flarum logo so fast (try a few times to reproduce the issue like I did on the video)
  4. Repeat from step 2 to 3 until you see the error (approx. repeat time 2-3)

Expected Behavior
The back button should disappear immediately from top left after the click to the browser's back button or the Flarum logo and "Flarum Community" should replace the topic title on the tab title.

Screenshots
screenshot_2018-07-03 issues with safari php - flarum community

87585678567856

Environment
Flarum Community
https://discuss.flarum.org

typbug

Most helpful comment

Do we have a solution to this fundamental problem?

It needs to be clearly defined, first. I guess, most asynchronous actions starting on one page should be canceled when navigating to other pages?

All 5 comments

Edited post and title to include that the bug also happens after a click on the Flarum logo.

Thanks for the detailed report 馃憤 was able to reproduce the issue with your instructions.

I suspect the issue is that the AJAX request for loading the discussion is finishing after the index page is rendered, so the followup discussion page logic (that which shows the back button and changes the document.title) executes on the index page.

GIF by @datitisev (originally posted in another issue):

GIF of issue

As @tobscure pointed out, the issue is the AJAX request finishing after the user changes the page.

Here's another GIF showing the bug with Chrome imitating a Slow 3G connection with DevTools.
The title gets set to the discussion page's title when the AJAX request finishes.

2018-07-14 16-37-36

Do we have a solution to this fundamental problem?

It needs to be clearly defined, first. I guess, most asynchronous actions starting on one page should be canceled when navigating to other pages?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jordanjay29 picture jordanjay29  路  3Comments

MichaelBelgium picture MichaelBelgium  路  4Comments

datitisev picture datitisev  路  3Comments

tobyzerner picture tobyzerner  路  4Comments

datitisev picture datitisev  路  4Comments