Editing topic (or topic title) removes the click-count badge for links in that topic

Note: this does not happen every single time, I’m not sure what the exact cause could be.

Since a few days/last 2-3 weeks I’ve had a few instances where I either edited a topic title, or some small change on the topic’s original post, and had the link click-counts be reset. The counts being reset to 0 is annoying, but not really that big of a deal. What is annoying and a slightly bigger deal is that this also removes any badges the user had earned about those links being clicked x amount of times.

For example:

  • I had a topic with a few links, one link having ~ 4k clicks.
  • I edit the topic title or something small in the topic (not even close to the link itself).
  • I save the post and all link count-badges were removed from the topic and I lost all badges related to the link click-count for that topic.

Sadly this does not seem to happen every time and I’ve not been able to reproduce this on multiple discourse forums so far.

I’m not sure if this is intended, but while trying to debug this i noticed in the admin tools of a post if I click on ‘rebuild html’ it also resets the link clicks-count.

Some (probably unrelated, but I’m not sure) context:

  • I am a moderator on the site where this happens.
  • I edited my own topics, I’ve not tried to do this on someone else’s topic out of fear of them losing their badges.
  • I also have the leader TL.
  • The site does not have any custom plugins that would reset the post or force it to rebuild somehow.
  • The forum version is: v2.2.0.beta4 +277

I’ve looked on meta but I’ve not been able to find a similar issue being reported (recently). If I’ve missed one then I’m sorry and you can close this topic.

To clarify, I’m talking about these:

Update: it is actually happening every time now on that one forum, still not been able to repro this on my own discourse forum however.

4 Likes

I’ll have a look :eyes:

I think this is due to the fix I made for Attachment "number of downloads" counter resets whenever a reply is edited.

4 Likes

Yep I see this too and it’s pretty frustrating cause you’re trying to track the history of links and it’s lost when an update is made to the 1st topic of a post.

Is there any way to recover the count or it’s gone forever when a post is edited?

Can you assign this @zogstrip because I am quite confused as to the current state of the fix?

4 Likes

@david can you investigate?

It seems that it’s not happening only on upload links but on any links.

I’ve rebaked one of my posts and it lost its click count :frowning: (before I changed the link to https)

Bonus points if you can find a retroactive way of fixing the URLs :sparkles:

EDIT: This topic might also be related.

6 Likes

We’ve had this bug since 18th October. If you had only 1 link in your post it would work fine. If you had multiple links, it would reset anything after the first one whenever the post was edited or rebaked.

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

I don’t think the other topic is related, but I’ll take a look at that as well.

7 Likes

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