-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AO3-4250 Made gift recipients update on blurbs on pseud / username changes #5063
Open
melinath
wants to merge
5
commits into
otwcode:master
Choose a base branch
from
melinath:AO3-4250
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c8cb063
AO3-4250 Made gift recipients update on blurbs on pseud / username ch…
melinath 5829463
AO3-4250 feed the rubodog
melinath 3b33148
AO3-4250 feed the rubodog a bit more
melinath 5b3cd90
AO3-4250 protect better against nils
melinath 087929a
Feed rubodog
melinath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,3 +202,34 @@ Feature: Delete pseud. | |
Then I should see "My Collection Thing" | ||
And I should not see "other_pseud (myself)" within "#main" | ||
And I should see "myself" within "#main" | ||
|
||
Scenario: Deleting a pseud updates series blurbs | ||
|
||
Given I am logged in as "Myself" | ||
And I add the work "Great Work" to series "Best Series" as "Me2" | ||
When I go to the dashboard page for user "Myself" with pseud "Me2" | ||
And I follow "Series" | ||
Then I should see "Best Series by Me2 (Myself)" | ||
|
||
When I delete the pseud "Me2" | ||
And I follow "Series" | ||
Then I should see "Best Series by Myself" | ||
|
||
Scenario: Deleting a pseud updates gift blurbs | ||
Given I have no users | ||
And the following activated users exist | ||
| login | password | email | id | | ||
| gifter | something | [email protected] | 1 | | ||
| giftee1 | something | [email protected] | 2 | | ||
And a pseud exists with name: "Me2", user_id: 2 | ||
And the user "giftee1" allows gifts | ||
And I am logged in as "gifter" with password "something" | ||
And I set up the draft "GiftStory1" | ||
And I give the work to "Me2 (giftee1)" | ||
And I press "Post" | ||
And I am logged in as "giftee1" with password "something" | ||
When I go to my gifts page | ||
Then I should see "GiftStory1 by gifter for Me2 (giftee1)" | ||
When I delete the pseud "Me2" | ||
And I go to my gifts page | ||
Then I should see "GiftStory1 by gifter for giftee1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,6 +253,30 @@ Scenario: Edit pseud updates series blurbs | |
When I follow "Series" | ||
Then I should see "Best Series by Me3 (Myself)" | ||
|
||
Scenario: Edit pseud updates gift blurbs | ||
Given I have no users | ||
And the following activated users exist | ||
| login | password | email | id | | ||
| gifter | something | [email protected] | 1 | | ||
| giftee1 | something | [email protected] | 2 | | ||
And a pseud exists with name: "Me2", user_id: 2 | ||
And the user "giftee1" allows gifts | ||
And I am logged in as "gifter" with password "something" | ||
And I set up the draft "GiftStory1" | ||
And I give the work to "Me2 (giftee1)" | ||
And I press "Post" | ||
And I am logged in as "giftee1" with password "something" | ||
When I go to my gifts page | ||
Then I should see "GiftStory1 by gifter for Me2 (giftee1)" | ||
When I go to my profile page | ||
And I follow "Manage My Pseuds" | ||
And I follow "Edit Me2" | ||
And I fill in "Name" with "Me3" | ||
And I press "Update" | ||
Then I should see "Pseud was successfully updated." | ||
When I go to my gifts page | ||
Then I should see "GiftStory1 by gifter for Me3 (giftee1)" | ||
|
||
Scenario: Change details as an admin | ||
|
||
Given "someone" has the pseud "alt" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,3 +117,26 @@ Scenario: Delete a user who has coauthored a work | |
And a user account should not exist for "testuser" | ||
When I go to orphan_account's series page | ||
Then I should see "Epic" | ||
|
||
Scenario: Deleting a user updates gift blurbs | ||
Given I have no users | ||
And I have no works or comments | ||
And the following activated users exist | ||
| login | password | email | id | | ||
| gifter | something | [email protected] | 1 | | ||
| giftee1 | something | [email protected] | 2 | | ||
And the user "giftee1" allows gifts | ||
And I am logged in as "gifter" with password "something" | ||
And I set up the draft "GiftStory1" | ||
And I give the work to "giftee1" | ||
And I press "Post" | ||
And I am logged in as "giftee1" with password "something" | ||
When I am on gifter's works page | ||
Then I should see "GiftStory1 by gifter for giftee1" | ||
When I try to delete my account as giftee1 | ||
Then I should see "You have successfully deleted your account." | ||
And a user account should not exist for "giftee1" | ||
And I should be logged out | ||
When I am on gifter's works page | ||
Then I should see "GiftStory1 by gifter" | ||
And I should not see "GiftStory1 by gifter for giftee1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,35 +182,104 @@ Feature: | |
And I should see "after" within "#main" | ||
And I should not see "before" within "#main" | ||
|
||
Scenario: Changing username updates series blurbs | ||
Scenario: Changing only username updates series blurbs | ||
Given I have no users | ||
And I am logged in as "oldusername" with password "password" | ||
And the following activated user exists | ||
| login | password | id | | ||
| oldusername | secret | 1 | | ||
And a pseud exists with name: "newusername", user_id: 1 | ||
And I am logged in as "oldusername" with password "secret" | ||
And I add the work "Great Work" to series "Best Series" | ||
When I go to the dashboard page for user "oldusername" with pseud "oldusername" | ||
And I follow "Series" | ||
Then I should see "Best Series by oldusername" | ||
When I visit the change username page for oldusername | ||
And I fill in "New user name" with "newusername" | ||
And I fill in "Password" with "password" | ||
And I fill in "Password" with "secret" | ||
And I press "Change User Name" | ||
Then I should get confirmation that I changed my username | ||
And I should see "Hi, newusername" | ||
When I follow "Series" | ||
Then I should see "Best Series by oldusername (newusername)" | ||
|
||
Scenario: Changing username and pseud updates series blurbs | ||
Given I have no users | ||
And I am logged in as "oldusername" with password "secret" | ||
And I add the work "Great Work" to series "Best Series" | ||
When I go to the dashboard page for user "oldusername" with pseud "oldusername" | ||
And I follow "Series" | ||
Then I should see "Best Series by oldusername" | ||
When I visit the change username page for oldusername | ||
And I fill in "New user name" with "newusername" | ||
And I fill in "Password" with "secret" | ||
And I press "Change User Name" | ||
Then I should get confirmation that I changed my username | ||
And I should see "Hi, newusername" | ||
When I follow "Series" | ||
Then I should see "Best Series by newusername" | ||
And I should not see "Best Series by oldusername" | ||
|
||
Scenario: Changing only username updates gift blurbs | ||
Given I have no users | ||
And the following activated users exist | ||
| login | password | email | id | | ||
| gifter | something | [email protected] | 1 | | ||
| giftee1 | something | [email protected] | 2 | | ||
And a pseud exists with name: "newusername", user_id: 2 | ||
And the user "giftee1" allows gifts | ||
And I am logged in as "gifter" with password "something" | ||
And I set up the draft "GiftStory1" | ||
And I give the work to "giftee1" | ||
And I press "Post" | ||
And I am logged in as "giftee1" with password "something" | ||
When I go to my gifts page | ||
Then I should see "GiftStory1 by gifter for giftee1" | ||
When I visit the change username page for giftee1 | ||
And I fill in "New user name" with "newusername" | ||
And I fill in "Password" with "something" | ||
And I press "Change User Name" | ||
Then I should get confirmation that I changed my username | ||
And I should see "Hi, newusername" | ||
When I go to my gifts page | ||
Then I should see "GiftStory1 by gifter for giftee1 (newusername)" | ||
|
||
Scenario: Changing the username from a forbidden name to non-forbidden | ||
Given I have no users | ||
And the following activated user exists | ||
| login | password | | ||
| forbidden | secret | | ||
And the user name "forbidden" is on the forbidden list | ||
When I am logged in as "forbidden" with password "secret" | ||
And I visit the change username page for forbidden | ||
And I fill in "New user name" with "notforbidden" | ||
And I fill in "Password" with "secret" | ||
And I press "Change User Name" | ||
Then I should get confirmation that I changed my username | ||
And I should see "Hi, notforbidden" | ||
Scenario: Changing username and pseud updates gift blurbs | ||
Given I have no users | ||
And the following activated users exist | ||
| login | password | email | id | | ||
| gifter | something | [email protected] | 1 | | ||
| giftee1 | something | [email protected] | 2 | | ||
And the user "giftee1" allows gifts | ||
And I am logged in as "gifter" with password "something" | ||
And I set up the draft "GiftStory1" | ||
And I give the work to "giftee1" | ||
And I press "Post" | ||
And I am logged in as "giftee1" with password "something" | ||
When I go to my gifts page | ||
Then I should see "GiftStory1 by gifter for giftee1" | ||
When I visit the change username page for giftee1 | ||
And I fill in "New user name" with "newusername" | ||
And I fill in "Password" with "something" | ||
And I press "Change User Name" | ||
Then I should get confirmation that I changed my username | ||
And I should see "Hi, newusername" | ||
When I go to my gifts page | ||
Then I should see "GiftStory1 by gifter for newusername" | ||
And I should not see "GiftStory1 by gifter for giftee1" | ||
|
||
Scenario: Changing the username from a forbidden name to non-forbidden | ||
Given I have no users | ||
And the following activated user exists | ||
| login | password | | ||
| forbidden | secret | | ||
And the user name "forbidden" is on the forbidden list | ||
When I am logged in as "forbidden" with password "secret" | ||
And I visit the change username page for forbidden | ||
And I fill in "New user name" with "notforbidden" | ||
And I fill in "Password" with "secret" | ||
And I press "Change User Name" | ||
Then I should get confirmation that I changed my username | ||
And I should see "Hi, notforbidden" | ||
|
||
Scenario: Tag wrangling supervisors are emailed about tag wrangler username changes | ||
Given the user "before" exists and is activated | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The discussion whether touching the works is the right cache busting strategy hasn't quite concluded, but it looks like we were leaning towards it. So, this can be optimized further.
For the gift works, the information is in the blurb. The blurb cache key depends on the work cache key, which depends on the work's updated_at. So it's enough to touch the work to bust the cache, no need to manually do so via
expire_caches
. That means that this can use the more optimised touch_all instead of looping through the gift works.Your PR doesn't say why you updated
pseud.works
to useexpire_caches
as well, but I think it should be fine to go back totouch_all
in this case too.