Replies do not link back to original post [Mobile]

AI-generated summary

Users reported a bug on mobile devices where clicking the “reply to” link (avatar arrow) fails to navigate back to the original post when the target post has not yet been loaded. TheMountainThatRoars noted the issue seems isolated to one user initially but linked to a specific thread. TheMountainThatRoars suggested the problem occurs because the forum hasn’t loaded the original topic post on mobile due to its size. Falco confirmed this is a known issue when the answer is more than N topics apart and not pre-loaded. codinghorror questioned if the latest version was deployed. sam identified the root cause as missing code to handle the “jump” on mobile when the linked post is unloaded, providing reproduction steps on the test site. Falco added that the bug predates the vdom implementation. thefreekick raised a related concern about screens jumping to random posts and displaying replies out of sequence after replying on mobile. eviltrout acknowledged the steps and provided a fix via a GitHub commit.

This is a strange one. All of the posts linked in the post below are replies, but the reply links at the top of the page (Arrow +avatar) do nothing.

To complicate things more, it seems relegated (so far) to one user.

https://talk.turtlerockstudios.com/t/replied-post-mobile/84768/16?u=themountainthatroars

「いいね!」 1

The user who reported the issue thinks that because he is viewing on mobile and the original topic is decently large that the post he’s trying to link back to hasn’t been loaded by the forum so there’s nothing to link back to.

There was a long standing bug that the link doesn’t work I’d the answer is more than N topics apart and isn’t pre loaded.

「いいね!」 1

Hmm, no, this should work. Perhaps latest was not deployed there, can you deploy it @eviltrout?

「いいね!」 1

I know what the issue is @eviltrout probably some code missing to handle the “jump” in mobile when the post being linked to is not loaded yet. @Falco is spot on.

Easy repro on try:

「いいね!」 6

Just gotta add that this bug is pre vdom.

I’m getting users on my hosted forum complaining that after they reply to a post on mobile that the screen jumps back to a random post further up the chain. And then the posts seem to be presented out of sequence. Not sure if that is related? I’m trying to get more details.

Thanks for the steps. Here’s a fix:

https://github.com/discourse/discourse/commit/7e97724341f41c6188667f4312eea221c0fb6e10

「いいね!」 3