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

fix: CleanInactiveUsersJob fails on Active Record validation fail #40

Merged
merged 7 commits into from
Nov 23, 2023

Conversation

Quentinchampenois
Copy link
Collaborator

@Quentinchampenois Quentinchampenois commented Nov 16, 2023

Description

If a user isn't valid, CleanInactiveUsersJob task will continuously fail, this is due to the command Decidim::DestroyAccount which attempts to invalidate_all_sessions before updating user's attributes.

Related to

Testing

  • Create multiple users with different current_sign_in_at
  • Run command bundle exec rake decidim_cleaner:clean_inactive_users
  • It should send email to concerned users

If you want to test the fix

  • Force a user attribute to a value that does not pass validations : (nickname: "####")
  • Run task
  • It should run without errors

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d3b7ee7) 89.69% compared to head (2df64db) 90.69%.
Report is 13 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #40      +/-   ##
===========================================
+ Coverage    89.69%   90.69%   +1.00%     
===========================================
  Files           14       15       +1     
  Lines          194      215      +21     
===========================================
+ Hits           174      195      +21     
  Misses          20       20              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Quentinchampenois Quentinchampenois force-pushed the fix/active_record_validations branch from e7aa6b9 to c1e5777 Compare November 16, 2023 16:07
@Quentinchampenois Quentinchampenois marked this pull request as ready for review November 17, 2023 09:29
@Quentinchampenois Quentinchampenois requested review from AyakorK and a team November 23, 2023 14:14
Copy link

@AyakorK AyakorK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great for me !

@AyakorK AyakorK merged commit c6461bd into develop Nov 23, 2023
8 checks passed
@AyakorK AyakorK deleted the fix/active_record_validations branch November 23, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants