Kudos do not update when kudos-giver changes username

Description

Steps to reproduce

1. Log in
2. Browse > Works
3. Follow a title to access a work
4. At the bottom of the work, press "Kudos"
5. Hi, username! > My Preferences > Change My User Name
6. Fill in required information
7. Press "Change User Name"
8. Press "OK" to confirm the name change
9. Return to the work and notice your old username is still in the kudos list

What should happen

The username information in the kudos should switch to your new username as quickly as possible. (This might take a while, since we'll have to look up every work the user has kudosed. However, in terms of performance, we're okay with doing this.)

Notes

Kudos belong to users, so when the user_id remains the same but the login of the user changes, it's a plain old caching issue.

Kudos are cached in two places, and the cache key is dependent on whether the work has been updated:

If the work creator or an admin edits the work you've kudosed, that will expire the cached kudos section and your name will update to match your new username.

Activity

Show:
redsummernight
March 20, 2020, 11:01 PM

After AO3-5597, kudos are associated with users instead of pseuds. I'll remove the pseud-related scenarios in the issue description.

redsummernight
January 23, 2020, 4:26 AM

Rails 6 has touch_all which would be amazing for this issue: https://blog.bigbinary.com/2019/03/12/rails-6-adds-activerecord-relation-touch-all.html.

Assignee

Unassigned

Reporter

Sarken

Roadmap

Users
Works

Priority

Medium

Affects versions

Fix versions

None

Components

BackEnd
Caching

Difficulty

Medium

Epic Link

Milestone

Internal 0.9