Incorrect Count on /tags page (included deleted topics - now fixed)

Summary: Over at Stonehearth it was noticed by an Admin today that the count on the /tags page is incorrect for some tags.

Steps to reproduce:

Unknown.

Expected Results:

Number next to tags matches number of topics seen when viewing individual tag page.

Actual Results:

Number next to tags is greater than the number of topics seen when viewing individual tag page.

Notes:

The difference between the number of topics with a tag and the number displayed appears to be constant i.e. ui had the number 5 but had 3 topics, adding the ui tag to another topics caused the number to increase to 6.

This is known to be an issue with the following tags (this list may be incomplete): ui, ai, crashes,

Attachments:


Version Number:

Discourse 1.7.0.beta7 (discourse.stonehearth.net)

System Information:

Windows 10 Education, Chrome Stable 54

Is it possible, itā€™s happening because of Topics deletion not reflected to Tags counting?

2 Likes

Also, Tags are still counted on any hidden topics/posts

just a thought, what are numbers when you are logged out, is it a permissions thing?

I checked adding ?status=deleted to the end to the URL, no deleted topics appeared. Iā€™m a moderator so I would see unlisted topics, and the person who reported this to me is an Admin, so she would see if there were any topics in an admin category that I couldnā€™t see.

Same issue when logged out. Still seeing the number 6 but 4 topics for ui.

I donā€™t fully understand ā€˜make a topic into a private messageā€™ yet, but i just made a topic, tagged it and turned it into a private message, and the tag count went up by one on the tag page.

could it be that?

deleting that private message keeps the tag count at +1

Certainly possible, but I highly, highly doubt it. We donā€™t use that function very much, and never for bug reports (the category where these tags are used).

I ran into this today and I think itā€™s caused by deleted topics.

Steps to reproduce:

  1. Create a new topic and add to it a new or existing tag;
  2. Navigate to the /tags page and memorize the count next to the tag you added to the new topic;
  3. Delete the new topic;
  4. Go back to the /tags page and youā€™ll see the tag count isnā€™t updated.

I can reproduce this constantly on my local install.

5 Likes

Iā€™m also seeing this problem with deleted topics, exactly as @Osama describes. Weā€™re using tags heavily in the project in question and have need to sometimes automatically create a large number of tagged topics (importing data from elsewhere). The auto-imports occasionally catch unrelated content and we delete the topics, but the orphaned tags and incorrect tag counts persist.

2 Likes

@clay do you have a step by step sequence on how we would reproduce this?

  1. Create a topic with tags

  2. Later, delete that topic.

The tags & count remain on the /tags page.

Iā€™m happy to give you access to the instance in question. Just PM me if so.

edit: not sure if it matters, but in step 2, ā€œLaterā€ means like a week later. I mention this in case thereā€™s a sidkiq job that runs on a delayed schedule that affects tag processing. For the instance in question, I deleted the topics mentioned months ago and the orphaned tags and incorrect counts remain.

3 Likes

@neil perhaps you can have a look at this?

4 Likes

I committed a fix for this issue. The counts wonā€™t include deleted topics from now on.

8 Likes

This topic was automatically closed after 6 days. New replies are no longer allowed.