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 user archival #434

Merged
merged 7 commits into from
Oct 11, 2024
Merged

Fix user archival #434

merged 7 commits into from
Oct 11, 2024

Conversation

wilco375
Copy link
Contributor

Summary

Fixes #428

User archival failed because a form can only have one response per user, but if multiple responses are archived they all get user id 0, which caused this validation to fail. The validation now explicitly excludes the archived user (id 0).
I also changed the user update statement to throw an error once an update fails. This makes it more clear where the error occurs. Regardless of this, user archival will fail anyways if the update fails because of foreign key constraints once the user is attempted to be deleted (as has been happening until now).

app/models/form/response.rb Outdated Show resolved Hide resolved
@wilco375 wilco375 added this pull request to the merge queue Oct 11, 2024
Merged via the queue into staging with commit 239a947 Oct 11, 2024
3 checks passed
@wilco375 wilco375 deleted the bugfix/user-archival branch October 11, 2024 20:33
Copy link

sentry-io bot commented Oct 12, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ActiveRecord::RecordInvalid: Failed to update Form::Response record (ID: 49) Sidekiq/UserCleanupJob View Issue

Did you find this useful? React with a 👍 or 👎

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.

User_cleanup_Job doesn't run properly
2 participants