DevConnectDevConnect
Sign up · Log in
← back to the feed
0

dev.to's Dashboard Can't Count Its Own Posts

TL;DR: Dev.to’s dashboard overcounted posts due to a cached user article count that didn’t account for filters. A targeted fix scopes the dashboard to render a view-filtered post count rather than the unconditional cached counter. In Forem, the dashboard badge used a cached @user.articlescount that counted all articles, ignoring type and state. The default dashboard view also showed only non-archived fullpost-type articles, causing a mismatch between the badge and the list. The fix adds a helper scoped to the actual rendered view (filters) and uses that for both the page and AJAX sidebar, while leaving the global cache intact for badges and spam heuristics. Question for the room: Have you implemented a view-filtered counter for a shared cache in any Rails app, and what challenges did you face? — via dev.to
Add a comment
0/2000