Open
Conversation
85f5e83 to
4c3c10a
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3224 +/- ##
==========================================
+ Coverage 70.33% 70.40% +0.07%
==========================================
Files 214 216 +2
Lines 6839 6860 +21
==========================================
+ Hits 4810 4830 +20
- Misses 2029 2030 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3238780 to
9988915
Compare
9988915 to
cb82a61
Compare
arkirchner
reviewed
Apr 20, 2026
cb82a61 to
b7bfbd7
Compare
Comment on lines
+14
to
+16
| end | ||
|
|
||
| head :ok |
There was a problem hiding this comment.
Bug: The user deletion API endpoint always returns a success status, even if the underlying user.soft_delete! operation fails to update the database.
Severity: HIGH
Suggested Fix
Check the boolean return value of user.soft_delete!. If it returns false, respond with an appropriate error status, such as head :unprocessable_entity, instead of head :ok. This ensures that failures in the soft-deletion process are correctly reported to the API client.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: app/controllers/api/internal/users/deletions_controller.rb#L14-L16
Potential issue: The `DeletionsController#delete` action calls `user.soft_delete!`,
which returns `false` if the database update fails. The controller does not check this
return value and unconditionally returns an `HTTP 200 OK` status. This misleads the
calling service (e.g., openHPI) into believing a GDPR-mandated user deletion was
successful when it actually failed. This behavior contradicts the established
error-handling pattern in an existing Rake task (`gdpr_delete.rake`), which explicitly
checks for failures from the same method, indicating that failures are an expected
possibility that must be handled.
This is a possible way to GDPR delete users via a API. The background is that if we delete a user on openhpi we also want to delete the user on codeocean. Part of SODEV-2997
b7bfbd7 to
62fa41c
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR introduces a possible way to GDPR delete users via a API.
If we delete a user on openHPI we also have to delete the user on codeocean. Previously this was handled via a rake task that has to be triggered manually.
Part of SODEV-2997