Editing post link leaves incorrect gutter link

AI-generated summary

A bug was reported where editing a post link leaves an incorrect gutter link. TechnoBear describes the steps to reproduce the issue and notes that the expected behavior is for the gutter link to be removed when the post link is edited. However, the actual behavior is that the gutter link remains. This issue occurs in Discourse versions 1.6.0.beta1 and 1.6.0.beta2 +102.

After the revamped right gutter was released, codinghorror suggested re-testing the issue, which TechnoBear did on the try.discourse site, confirming that the issue still exists. codinghorror then requested a fix, which eviltrout provided in the form of a GitHub commit.

Steps to reproduce:

Create a post, including a link to post A in Another Topic.

A link to Another Topic will appear in the gutter beside the new post, and a link to Your Post Topic will appear in the gutter beside post A.

Edit the post link to point instead to post B in A Different Topic.

The gutter link changes to show A Different Topic, and a link to Your Post Topic will appear in the gutter beside post B.

Expected behaviour: the gutter link beside post A will be removed.
Actual behaviour: the gutter link remains beside post A, even though the post link no longer exists.

This behaviour occurs whether the link is edited within the “ninja edit” window or not, and irrespective of whether the link is posted using anchor text or a plain link. The “false” link is still present after 24 hours, so is not cleared via sidekiq.

Deleting the link altogether does remove the gutter link; editing it does not.

Seen on v1.6.0.beta1 and tested on v1.6.0.beta2 +102.

6 Me gusta

Can you repro this with the new state of affairs?

1 me gusta

You mean the revamped right gutter? I can’t really test it, unless you want me messing about here on Meta; it doesn’t seem to be on try.discourse yet.

1 me gusta

True, it will be on try by Tuesday of next week. Let’s check back then.

2 Me gusta

Also this was originally tested on my sandbox which is always up to date.

4 Me gusta

OK - I’ve just tested on Try and the issue exists there, too.

3 Me gusta

@eviltrout I think we should fix this since it still reproduces.

2 Me gusta

Here’s a fix for this one. Took longer than I thought because I kept getting confused between what I was linking to and where I was being linked from :confounded:

https://github.com/discourse/discourse/commit/e38f17524b121be0a9482c0c59816afa7263a65f

7 Me gusta