Topic title duplicated in header

I’ve started noticing this about a week or so ago. I’ve yet to get a consistent repro - but it seems to occur after editing a topic (as TL3 here on Meta, or Moderator at Stonehearth).

Here’s what I’ve been seeing:

On a topic that can scroll, moving down (go to a later post) then back up resolves it. On a topic without scroll, I have to refresh the page to resolve it.

Has anyone else seen this?

Edit: just made a ninja edit to fix a typo, got the bug in this very topic!

Edit 2: And it happened again after the edit to add the image. Perhaps repro is being scrolled to topic of topic when making an edit…

1 Like

What is the exact repro? I am not clear.

I’m still not sure this is 100% reproducible - haven’t had time to attempt repro in my dev instance.

Here’s what I think is the repro:

  1. Create a topic (or have permissions to edit topics).
  2. Open the topic editor.
  3. Scroll the topic view behind the editor to the very top.
  4. Make and edit and save.
  5. See the “duplciated” title
2 Likes

I just tried this on my dev setup.

  1. Open existing topic
  2. Click the pencil to edit the original post.
  3. Scroll down to bottom of topic.
  4. Scroll up to top of the topic.
  5. Save edit.
  6. See double title
4 Likes

@eviltrout can you have a look at this?

3 Likes

Another simple repro on local

  • Open 2 tabs looking at same topic, be scrolled to top.
  • Edit title in one tab
  • Go to second tab and header re-rendered with this bug

So messagebus is telling page to re-render header (correctly) but the check of what state it should be is somehow omitted.

3 Likes

An easy reproduction is here:

(opened another thread because i didnt knew about this one)

5 Likes

Hello,

I just fixed this and submitted a pull request.

https://github.com/discourse/discourse/pull/4760

EDIT: To explain a little bit how I tracked the bug:

  1. I tried reproducing and found out that it actually reproduces by changing a topic’s title.
  2. I found out that there are two events that control the header and if the topic title is shown or not: header:show-topic and header:hide-topic.
  3. Searched where header:show-topic is triggered and found a match when a topic is reloaded (which happens when a topic is edited).
  4. I changed the code to trigger header:show-topic only if the the topic title is not visible (not the one from the header, but the proper one, #topic-title).
11 Likes

Thanks, looks like @sam merged it recently :slight_smile:

3 Likes