Full-page search confuses the record of the latest post you read

This is affecting me heavily on WTDWTF; when I click on a topic that has updates on the topic list, I frequently am taken to a post that is dozens, hundreds, or in one case a thousand posts higher than the actual new post I was trying to reach. This seems to be triggered by visiting the full-page search results; I think it’s setting the unread marker to where the search result was.

One of our users managed to trigger the behavior as follows:

  1. Open the search bar
  2. Type a phrase that appears somewhere far up the topic than your latest read position.
  3. Click “show more”
  4. Look at the URL for the topic in question
  5. Click the site logo to return to the “latest” list.
    6, Look at the URL for the topic in question

Expected: Should point to the last read position, or the last post in the thread if all are read
Actual: Points to the same URL noted in step 4.

7 Likes

@eviltrout Discoure.URL.routeTo is terribly broken can you have a look?

very annoying workaround is to reload the page but… yuck

1 Like

I’ll try that, but I’m hearing anecdotal reports that reloading the page does not work. Posting in the thread does, though that’s annoying because it impacts everyone else.

Reloading definitely works, this is a client side bug, so destroying all client side state sorts it out.

Can you still repro this on meta? I just improved some of the internal routing.

https://github.com/discourse/discourse/commit/078177cf7989a84d673cbef58e4390feae1923e9

3 Likes

:+1: Fixes this too. Full page search does not update when changing query in search dropdown

3 Likes

My understanding is that still happening, anyone that can repro, please let me know how @yamikuronue ?

1 Like

This might not just be search.

Still happens.

Open the topic https://meta.discourse.org/t/plugin-system-upgrades/16120/ and read through to post 38

Search for " so in ruby land"

Now your read marker is at post 30

This sounds a bit different to the OP, can you repro the OP somehow?

Huh? I did the same thing, I was just briefer about writing it up.

Better repro steps:

  1. Look at the topic list. Scroll down to find Plugin System Upgrades and click it
  2. Read to the end
  3. Return to the topic list. Find the thread again.
  4. Click it. You should be on the last post
  5. Search for “so in ruby land”
  6. Open the full-page search results (click “show more” or hit enter)
  7. Return to the topic list. Find the thread again
  8. Click it. Expected: last post. Actual: post 30, the post with “so in ruby land” in it.

Easier repro

@eviltrout can you have a look?

2 Likes

Not ember related. The search results were using latest as the preload store key, so when you went to that URL it was loading the cached version. Fixed here:

https://github.com/discourse/discourse/commit/32a1610b5d9484c8db944a41716c4c13174c0ef5

4 Likes

This topic is now closed. New replies are no longer allowed.

Confirmed fix, if still happening flag to reopen