Dev.to Dashboard Bug Showed Inflated Post Counts Due to Unfiltered Cache
A bug in Forem, the open-source platform powering dev.to, caused the dashboard's 'Posts' counter to display a higher number than the posts actually visible to users. The issue stemmed from the sidebar badge relying on a raw articles_count cache that tallied all article types — including short status updates and archived posts — while the default dashboard view only displays active, full-length posts. The mismatch was identified through GitHub issue #23687, where a user who had published one post saw a count of two. A contributor traced the bug through the codebase and submitted a fix via pull request #23690, introducing a scoped helper method that counts only non-archived, full-post-type articles to match what the Posts tab actually renders. The broader articles_count cache was left untouched, as it serves other platform functions where a total article count is the intended behavior.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in