fix: ensure to return delete requests only for the requested tanent - #18589
Merged
Conversation
sandeepsukhani
left a comment
Contributor
There was a problem hiding this comment.
Thank you for fixing the issue! I have left a minor comment to improve the fix a bit.
Can you please take care of it?
Comment on lines
+214
to
+221
| filteredDeleteGroups := []DeleteRequest{} | ||
| for _, dr := range deleteGroups { | ||
| if dr.UserID == userID { | ||
| filteredDeleteGroups = append(filteredDeleteGroups, dr) | ||
| } | ||
| } | ||
|
|
||
| deleteRequests := mergeDeletes(filteredDeleteGroups) |
Contributor
There was a problem hiding this comment.
We can avoid doing this by using []byte(userID + ":") for RangeValuePrefix on line 208. This would also let us fetch only the required records from the database.
sandeepsukhani
approved these changes
Jul 26, 2025
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.
What this PR does / why we need it:
When api used to query delete requests for a tanent/userID, this we returning delete requests for all tanent with similar prefix in their name. For example when getting delete request for
tanent-1we also endup getting delete requests fortenant-12because their prefix match.In this PR, This will filter out the irrelevant delete requests and only return the one that is exact match with the provided tenant/userID. (Test included)
Which issue(s) this PR fixes:
Fixes #18585