Topic list not refreshing on back button


(Sam Saffron) #1

To repro (in chrome):

  1. Open 2 browsers to try homepage
  2. (browser 2) click on a topic
  3. (browser 2) make a post
  4. (browser 1) Click on the “1 new or updated topic”
  5. (browser 1) click on topic
  6. (browser 1) click back

On step 6 browser no longer makes a json call to “latest” meaning the page is out of date.

@eviltrout can you have a look cause I have been hitting this lots today.


(Sam Saffron) #2

Possibly related, I just got this when I clicked on a topic in the suggested list.


(Robin Ward) #3

We’ve cached the topic list for hitting the back button for ages now. When I try to reproduce it indeed does not request the JSON, but the topic list seems the same because the added topic was cached.

What is the problem here? You hit back after a long time and don’t see the updates? Because if it’s soon after the cache works quite well IMO.


(Sam Saffron) #4

Unread count is wrong, blue circles appear in the wrong spots. It’s confusing


(Jeff Atwood) #5

This is going to make people think we perform worse than we already do, if we do another JSON request on every back button.

Maybe do it only if the original cache is way out of date like 5+ minutes?


(Sam Saffron) #6

Discussed with @eviltrout the technical reason is for maintaining scroll position, its not about perf.

He is looking at a fix.


(lid) #7

The problem is that when the user is on the topic list and receive
If the user either miss due to scroll position or ignore the message and instead enter a topic and then hit the back button it will result in

  1. An outdated topic list
  2. The update message will not persist

Right now it appears that on try.discourse under certain circumstances , the back button will trigger a reload/refresh the list.

What is not taken into account is that the app is already acknowledged that there are updates to the topic list.
but loses that information on navigating out and back.


possible solution:

  1. Persist the update bar in the topic list view, even if the user go to a topic and hit back.
    That information would need to be attached to that view.

(Robin Ward) #8

Right but it’s also faster to not request it again if we don’t have to. I’m going to try and correct it. If I can’t get the counts to work correctly I’ll just refresh.


(Jeff Atwood) #9