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: do not iteratively delete records #3766

Merged
merged 16 commits into from
Jun 7, 2024
Merged

Conversation

aeneasr
Copy link
Member

@aeneasr aeneasr commented May 8, 2024

Resolves performance issues on some databases when deleting consent.

BREAKING CHANGES: Deleting consents no longer returns 404 in certain edge cases but instead always 204.

Related issue(s)

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

@aeneasr aeneasr requested review from hperl and alnr as code owners May 8, 2024 13:35
@@ -744,8 +744,8 @@ func ManagerTests(deps Deps, m consent.Manager, clientManager client.Manager, fo
})
}

require.EqualError(t, m.RevokeSubjectConsentSession(ctx, "i-do-not-exist"), x.ErrNotFound.Error())
require.EqualError(t, m.RevokeSubjectClientConsentSession(ctx, "i-do-not-exist", "i-do-not-exist"), x.ErrNotFound.Error())
require.NoError(t, m.RevokeSubjectConsentSession(ctx, "i-do-not-exist"))
Copy link
Member Author

Choose a reason for hiding this comment

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

Returning 404 on not found was not documented and is also inconsistent with other apis that return 204 on deletes that touch no rows.

@aeneasr aeneasr merged commit 5ef20a2 into master Jun 7, 2024
29 checks passed
@aeneasr aeneasr deleted the improve-consent-removal branch June 7, 2024 11:48
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.

None yet

1 participant