Calculated read time is high though there is only one post

AI-generated summary

A bug was reported where the calculated read time for a topic with only one visible post was incorrectly showing over 3 hours, due to deleted posts still being counted in the word count and link tally. Moin first noticed the issue on the Custom Wizard Plugin topic, where the JSON data revealed 95,026 words despite only one active post. awesomerobot confirmed the problem stems from deleted posts not being excluded during read time calculation, and noted 31 lingering links from deleted replies. sam identified the root cause: the Post Revisor and Post Destroyer modules fail to exclude or clean up data from deleted posts. A fix was proposed via pull request #27065 by zogstrip. After the fix, Moin confirmed the read time dropped significantly (to 344 and 28 minutes in different screenshots), though the 30 leftover links from deleted posts remain unresolved.

I noticed that the read time shown at some topics seems very high compared to the number of posts.
For example, there is only one post at the Custom Wizard Plugin 🧙 topic, but the read time is more than 3 hours.


Are deleted posts included when the read time is calculated?

5 Likes

Hah, yeah, I don’t think you need a full 3 hours to read that topic. Good attentive eye!

6 Likes

Looking at https://meta.discourse.org/t/custom-wizard-plugin/73345.json… the posts_count there is correctly 1… but the word count is 95026 :exploding_head: — looks like this isn’t being updated when replies are deleted.

I also notice that there are 31 links listed… so those are coming through deleted replies as well.

7 Likes

Oh my… this is a double bug:

Post Revisor is not excluding posts with deleted_at not null

And Post Destroyer does nothing: discourse/lib/post_destroyer.rb at 45abb67f432bd009ca1bfef3e7735e632a4299fd · discourse/discourse · GitHub

So there is no workaround here even.

We will sort it out

3 Likes

Having a quick look :face_with_monocle:

2 Likes

This will be fixed by :point_down:

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

5 Likes

Works great. Thank you!

Those are still there.

2 Likes

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