Skip to content

AO3-7536 Expire creator comment caches when creatorships of anonymous work change - #5943

Open
hab-bang wants to merge 1 commit into
otwcode:masterfrom
hab-bang:AO3-7536-creator-comment-cache-not-expired-creatorships-of-anon-change
Open

AO3-7536 Expire creator comment caches when creatorships of anonymous work change#5943
hab-bang wants to merge 1 commit into
otwcode:masterfrom
hab-bang:AO3-7536-creator-comment-cache-not-expired-creatorships-of-anon-change

Conversation

@hab-bang

Copy link
Copy Markdown

Pull Request Checklist

Issue

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

Purpose

Expiring the cached comment bylines when the creatorships of an anonymous work (a work in an anonymous collection) change, so comments by the affected user start or stop displaying as "Anonymous Creator" correctly.

As described in the Jira ticket, AO3-3712 (#1289) added cache busting for creator comments when a work is added to or removed from an anonymous collection, but there was no such thing for creatorship changes on a work that stays anonymous. So when a creator removed themselves via "Remove Me As Co-Creator" (or was re-added and accepted), their comments kept showing the wrong byline until the 1-week fragment cache expired.

This PR adds a Creatorship callback that enqueues a new Work#poke_cached_creator_comments_for_user, touching the affected user's comments on the work so their bylines re-render. The existing Work#poke_cached_creator_comments could not be reused here: it looks up the work's current creators, and a removed creator has already left that list by the time the background job runs so that their comments would be the ones skipped. Passing the user's id captured at the moment the creatorship changes covers both removal and re-adding.

The added feature scenario fails without the Creatorship and Work changes, and passes with them.

Testing Instructions

Follow the reproduction steps on the Jira issue (post a work with a co-creator into an anonymous collection, comment as a creator, then remove yourself via Edit => "Remove Me As Co-Creator"):

  • Before this change: the comment still shows "Anonymous Creator" after the removal (until the weekly cache expiry).
  • After this change: refreshing shows the commenter's username once the background job has run.
  • Afterwards, re-inviting the removed user and the user accepting the co-creator request re-anonymizes their comments to "Anonymous Creator".

Reproducing locally requires fragment caching to be enabled (rails dev:cache) and a Resque worker running.

You can also see the testing instructions are also on the Jira ticket.

References

AO3-3712 (https://otwarchive.atlassian.net/browse/AO3-3712, #1289) introduced the equivalent cache busting for collection-anonymity changes; this PR follows the same pattern for creatorship changes and reuses its touch-based invalidation approach.

Credit

Name: hayoung
Pronouns: she/her

@hab-bang

Copy link
Copy Markdown
Author

Hi @Bilka2. Sorry if I shouldn't be tagging you; I saw that you are the reporter of the original Jira ticket and this PR has been sitting for five days and I'm not really sure what I should do next. Could you let me know if you need anything from me?

Thank you in advance!

@Bilka2

Bilka2 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

As explained in our contributing guidelines, please be patient with us. Due to our workload, it may take some time before we can review and eventually merge your pull request.

As you can tell from the overall pull request list, we have a backlog of about 40 non-draft pull requests awaiting review, some of them as old as April of this year. While we prioritize some pull requests for reviewing and merging, such as the first pull request by each person, generally it may take some time until someone gets to them.

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.

2 participants