Skip to content
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

Merge upstream changes up to a2624ff739ea555888f27b13a44f7d6b1af35a86 #2544

Merged
merged 31 commits into from
Dec 29, 2023
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b5ac61b
Change algorithm of follow recommendations (#28314)
Gargron Dec 19, 2023
4075b4d
Update dependency node to 20.10 (#28040)
renovate[bot] Dec 19, 2023
5489d4c
Update dependency aws-sdk-s3 to v1.141.0 (#28116)
renovate[bot] Dec 19, 2023
c7c7279
Add spec for `CLI::Maintenance#fix_duplicates` (#28326)
mjankowski Dec 19, 2023
6fed0fc
Remove unneeded settings cleanup from specs (#28425)
ClearlyClaire Dec 19, 2023
961d65a
Add coverage to CLI Maintenance for duplicate users on `confirmation_…
mjankowski Dec 20, 2023
9a24b12
Update dependency sass-loader to v10.5.1 (#28432)
renovate[bot] Dec 20, 2023
fecc078
New Crowdin Translations (automated) (#28439)
github-actions[bot] Dec 20, 2023
ac04e62
Remove unused route definitions (#28430)
ClearlyClaire Dec 20, 2023
d29b1cc
Fix `friends_of_friends` sometimes suggesting already-followed accoun…
ClearlyClaire Dec 20, 2023
01f0a6c
Fix profile setup showing default avatar in web UI (#28453)
Gargron Dec 21, 2023
2463b53
More duplicates in cli maintenance spec, misc bug fixes (#28449)
mjankowski Dec 21, 2023
9e5ddc1
New Crowdin Translations (automated) (#28451)
github-actions[bot] Dec 21, 2023
87e2bd0
Update dependency irb to v1.11.0 (#28442)
renovate[bot] Dec 21, 2023
c753b1a
Clean up of `RSpec/LetSetup` within `spec/models` (#28444)
mjankowski Dec 21, 2023
f32d672
Clean up of `RSpec/LetSetup` within `spec/controllers` (#28446)
mjankowski Dec 21, 2023
5976d37
Change "Follow" to "Follow back" and "Mutual" when appropriate in web…
Gargron Dec 21, 2023
cd64a5b
Clean up of `RSpec/LetSetup` within `api/` (#28448)
mjankowski Dec 21, 2023
c99f88e
Clean up of `RSpec/LetSetup` within `spec/lib` (#28447)
mjankowski Dec 21, 2023
efd16f3
Clean up of `RSpec/LetSetup` within `spec/services/activitypub` (#28445)
mjankowski Dec 21, 2023
9251779
Fix `RSpec/LetSetup` cop in spec/services (#28459)
mjankowski Dec 21, 2023
1c04135
Fix error on viewing a profile when unlogged (#28465)
renchap Dec 21, 2023
43547cd
Update dependency debug to v1.9.1 (#28466)
renovate[bot] Dec 22, 2023
e70a657
New Crowdin Translations (automated) (#28467)
github-actions[bot] Dec 22, 2023
513d359
Fix `RSpec/LetSetup` cop in auth controller specs (#28464)
mjankowski Dec 22, 2023
e6e217f
Clean up `tagged_with_*` Status specs, fix `RSpec/LetSetup` cop (#28462)
mjankowski Dec 22, 2023
a4d49c2
Fix `RSpec/LetSetup` cop in ap/fetch_featured_collection_service (#28…
mjankowski Dec 22, 2023
2bf84b9
Fix media attachment order of remote posts (#28469)
ClearlyClaire Dec 22, 2023
bb8077e
Fix `RSpec/LetSetup` cop in models/account_status_cleanup_policy (#28…
mjankowski Dec 22, 2023
a2624ff
Convert signature verification specs to request specs (#28443)
ClearlyClaire Dec 22, 2023
c5b0e6d
Merge branch 'main' into glitch-soc/merge-upstream
ClearlyClaire Dec 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add coverage to CLI Maintenance for duplicate users on `confirmation_…
…token` and `reset_password_token` values (mastodon#28434)
mjankowski authored Dec 20, 2023
commit 961d65aba6432d83e70a5e8ee720034b87064d02
60 changes: 59 additions & 1 deletion spec/lib/mastodon/cli/maintenance_spec.rb
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ def prepare_duplicate_data
end
end

context 'with duplicate users' do
context 'with duplicate users on email' do
before do
prepare_duplicate_data
end
@@ -117,6 +117,64 @@ def prepare_duplicate_data
end
end

context 'with duplicate users on confirmation_token' do
before do
prepare_duplicate_data
end

let(:duplicate_confirmation_token) { '123ABC' }

it 'runs the deduplication process' do
expect { subject }
.to output_results(
'Deduplicating user records',
'Unsetting confirmation token',
'Restoring users indexes',
'Finished!'
)
.and change(duplicate_users, :count).from(2).to(1)
end

def duplicate_users
User.where(confirmation_token: duplicate_confirmation_token)
end

def prepare_duplicate_data
ActiveRecord::Base.connection.remove_index :users, :confirmation_token
Fabricate(:user, confirmation_token: duplicate_confirmation_token)
Fabricate.build(:user, confirmation_token: duplicate_confirmation_token).save(validate: false)
end
end

context 'with duplicate users on reset_password_token' do
before do
prepare_duplicate_data
end

let(:duplicate_reset_password_token) { '123ABC' }

it 'runs the deduplication process' do
expect { subject }
.to output_results(
'Deduplicating user records',
'Unsetting password reset token',
'Restoring users indexes',
'Finished!'
)
.and change(duplicate_users, :count).from(2).to(1)
end

def duplicate_users
User.where(reset_password_token: duplicate_reset_password_token)
end

def prepare_duplicate_data
ActiveRecord::Base.connection.remove_index :users, :reset_password_token
Fabricate(:user, reset_password_token: duplicate_reset_password_token)
Fabricate.build(:user, reset_password_token: duplicate_reset_password_token).save(validate: false)
end
end

def agree_to_backup_warning
allow(cli.shell)
.to receive(:yes?)