Browser back button doesn't retrieve observation page properly after specific sequence of actions

It takes a very specific sequence of events to reproduce this problem. First, I’m going to first walk through through a case first where things work as expected. Then I’ll modify that case slightly to get a non-working case.

I was able to reproduce the problem using both Edge (Chromium) and Firefox on Windows 10.

Working Case

  1. Open up Your Observations. By default, this will show your observations, ordered by Date Added (descending). (Technically, you could also use any other user’s observations, but it’s easiest to use your own.)
  2. Open your 3rd most recently added observation. (Technically, it could also be any observation other than the latest one, but I’m going to use the 3rd most recent because I think it demonstrates the issue most clearly.)
  3. In the observation page, open your 2nd most recently added observation by clicking the green next button near the top-right corner of the page.
  4. In the observation page, open your most recently added observation by clicking the green next button near the top-right corner of the page.
  5. At this point, you should have your most recently added observation open, and the green next button should be disabled.
  6. Click your browser’s back button. This should take you back to your 2nd most recently added observation.
  7. Click your browser’s back button. This should take you back to your 3rd most recently added observation.

Non-working Case

  1. Repeat steps 1-5 from the Working Case
  2. Click your browser’s reload button. This should reload your most recently added observation. No issues yet.
  3. Now click your browser’s back button. You would expect your 2nd most recently added observation to be loaded, but the page is only partially loaded. (The site header and footer are loaded, but the middle section is not.)
  4. Click your browser’s back button. You would expect your 3rd most recently added observation to be loaded, but the page is only partially loaded.
  5. Click your browser’s forward button. The page for your 2nd most recently added observation is still only partially loaded.
  6. Click your browser’s forward button. You would expect your most recently added observation to be loaded, but the page is only partially loaded.
  7. Open your browser’s Developer Tools, and look for messages in the console. You’ll find errors that indicate something like:
    • (Edge) TypeError: Cannot read properties of undefined (reading 'login') at PreviousNextButtons
    • (Firefox) TypeError: observation.user is undefined
  8. Click the browser’s reload button. Your most recently added observation should load just fine.

Additional Notes

  1. Here’s a screenshot of a partially loaded page with console error messages just for reference:

  2. The Non-working Case is described using your own most recent observations. But you could reproduce the same kind of problem using:

    • another user’s most recent observations (instead of your own)
    • the first added observations + previous button (instead of the most recent observations + next button)
4 Likes

I can reproduce the same problem on a Mac with Safari 15.0 (latest) on macOS 11.6 (latest), so this isn’t Windows-specific.

I have often seen that going Back to a previously viewed observation fails in this way, but I’ve never figured out a reproducible pattern. Kudos @pisum for doing so!

2 Likes

Yeah, I can replicate. Added to my report.

i think this has been resolved, as i can no longer recreate the issue.

1 Like

Agreed, I can no longer reproduce on a Mac with Safari 15.1 (latest) on macOS 12.0.1 (latest).

2 Likes