Skip to content

AO3-6822 Fix comment count N+1 on work blurbs by reading preloaded stat_counter#5917

Draft
sherin wants to merge 2 commits into
otwcode:masterfrom
sherin:works_n_plus_one
Draft

AO3-6822 Fix comment count N+1 on work blurbs by reading preloaded stat_counter#5917
sherin wants to merge 2 commits into
otwcode:masterfrom
sherin:works_n_plus_one

Conversation

@sherin

@sherin sherin commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-6822

Purpose

Removes n+1 query from counting comments for every work in works controller. It uses the precomputed comment count from StatCounter.

Risk: If the data in StatCounter is stale, the total count of comments will also be stale or inaccurate. I am assuming that is alright.

Testing Instructions

How can the Archive's QA team verify that this is working as you intended?

If you have a Jira account with access, please update or comment on the issue
with any new or missing testing instructions instead.

You can remove this section if there are already full testing instructions in the Jira issue.

References

Are there other relevant issues/pull requests/mailing list discussions? If not, you can remove this section.

Credit

What name and pronouns should we use to credit you in the Archive of Our Own's Release Notes?

If you have a Jira account, please include the same name in the "Full name"
field on your Jira profile, so we can assign you the issues you're working on.

Please note that if you do not fill in this section, we will use your GitHub account name and
they/them pronouns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant