Links to hidden messages don't clear filters

AI-generated summary

Nacho_Caballero reported a bug where clicking links to hidden replies in a thread doesn’t properly reveal the target post — sometimes scrolling occurs but the post remains hidden, or the wrong post appears (e.g., linking to post #8 shows #7 instead). The issue also affects @mention notifications that link to filtered replies within the same thread as explained in post 7. pmusaraj confirmed it’s a single bug, albeit an edge case, and added it to their todo list. Later, pmusaraj fixed the issue via a GitHub commit. Nacho_Caballero confirmed the fix works perfectly and praised the concise solution.

I don’t know if this is one bug or two, but here are the steps to reproduce them. I’ve had to do it here instead of in try.discourse.org because filtered replies are not enabled there.

  1. Go to post #6 in this thread, scroll to the bottom and click to see its 6 replies:

  2. Scroll to the last post (number #25, which is a direct reply of #6) and click its link to post number #24:

Expected behavior: post #24 becomes visible (filters might or might not get removed)

Actual behavior: the page scrolls up and down, but #24 never appears

On to bug #2:

  1. Click on View 6 hidden replies

  2. Scroll down until you see post #24 and click its link to post #8

Expected behavior: #8 appears

Actual behavior: #7 appears

1 Like

@pmusaraj If you have time, could you confirm if this is indeed a bug (or two) or if it’s the intended behavior? Maybe I’m misinterpreting something.

Yes, this looks one and the same bug. It’s a considerable edge case, it is quite rare to link to replies like in the example, but I will add this to my todo list.

1 Like

A more common case is when the link is actually a @mention notification

Hmm, I’m not following, how would a mention link to a reply in the same post stream?

I used a link to make the example reproducible, but this was actually reported by a user who was seeing a filtered reply and received a mention on the same topic. When they clicked on the notification, they got the behavior I reported

2 Likes

This is fixed now @Nacho_Caballero via DEV: Clear filters when navigating to a post (#12557) · discourse/discourse@524890c · GitHub

3 Likes

That works perfectly! Thanks, Penar.

That took surprisingly little code to fix, but I don’t think I’d been able to figure it out on my own. :sweat_smile:

1 Like

This topic was automatically closed after 16 hours. New replies are no longer allowed.