In the latest digest one of my accounts received, none of the topics were duplicated, but the comments below them were (“Popular Posts”). There were five slots and two duplicates (three unique posts), both from the same topic.
Edit: I’m looking through some historical digests that were sent to different test/admin accounts:
The previous one also has two duplicates in the Popular Posts, also from that same topic.
The one before that had a duplicate topic but no duplicate Popular Posts. There’s a duplicate in “New for you”.
@j127, it would be interesting to know how many tags your digest topics had. In my recent samples, duplication corresponds with the number of tags on a topic. Might be a coincidence – or might not.
I’ve been able to reproduce the issue on my local Discourse site by adding a tag to the digest suppress tags site setting and then creating a topic with multiple tags.
if SiteSetting.digest_suppress_tags.present?
tag_ids = Tag.where_name(SiteSetting.digest_suppress_tags.split("|")).pluck(:id)
if tag_ids.present?
topics =
topics.joins("LEFT JOIN topic_tags tg ON topics.id = tg.topic_id").where(
"tg.tag_id NOT IN (?) OR tg.tag_id IS NULL",
tag_ids,
)
end
end
Edit: I don’t think a LEFT JOIN is needed here. The columns from the joined topic_tags table don’t seem to get used later in the method. The fix could be as simple as:
if SiteSetting.digest_suppress_tags.present?
tag_ids = Tag.where_name(SiteSetting.digest_suppress_tags.split("|")).pluck(:id)
if tag_ids.present?
topics =
topics.where.not(id: TopicTag.where(tag_id: tag_ids).select(:topic_id))
end
end
I’ll leave it for the Discourse team to figure out the best approach. The for_digest method gets run a lot of times and needs to be efficient.
@simon – thank you so much for running this down! I’m sure it was a lot to sift through. I’ll look forward to the Discourse team returning & acting on your analysis.
Just confirming that removing the tag I had in digest suppress tags has returned the summaries to normal. (I’m relying on digest suppress categories in the meantime.)
I’m not entirely clear on when merged commits are available in the beta channel. If I’m on 3.4.0.beta3-dev (53f9c81790) and it’s not requesting a GUI update, will a command line update pick up this change?