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(dao) add recursion over entities that need to be cascade-deleted #9261

Merged
merged 1 commit into from
Aug 22, 2022

Conversation

gruceo
Copy link
Contributor

@gruceo gruceo commented Aug 17, 2022

In a scenario where consumer entities were deleted, the
oauth2_tokens entities didn't have their caches invalidated. This is
because the find_cascade_delete_entities function was only finding
entities up to a maximum of two levels. So in this case where
consumer is referenced by oauth2_credentials and
oauth2_credentials is referenced by oauth2_tokens (consumer ->
oauth2_credentials -> oauth2_tokens), only the consumer and
oauth2_credentials had their cache invalidated, the oauth2_tokens
caches had their cache still valid after a /consumers DELETE operation. The
find_cascade_delete_entities function of the DAO module needs to be
recursive because of this issue. So this PR is doing that, plus it's
adding unit tests along with integration tests for the oauth2 plugin.

Fix FTI-2023

In a scenario where `consumer` entities were deleted, the
`oauth2_tokens` entities didn't have their caches invalidated. This is
because the `find_cascade_delete_entities` function was only finding
entities up to a maximum of two levels. So in this case where
`consumer` is referenced by `oauth2_credentials` and
`oauth2_credentials` is referenced by `oauth2_tokens` (consumer ->
oauth2_credentials -> oauth2_tokens), only the `consumer` and
`oauth2_credentials` had their cache invalidated, the `oauth2_tokens`
caches had their cache still valid after a DELETE operation. The
`find_cascade_delete_entities` function of the DAO module needs to be
recursive because of this issue. So this PR is doing that, plus it's
adding unit tests along with integration tests for the `oauth2` plugin.

Fix FTI-2023
@gruceo gruceo requested a review from a team as a code owner August 17, 2022 15:22
@gruceo gruceo added this to the 3.0 milestone Aug 17, 2022
@gruceo gruceo merged commit bef5483 into master Aug 22, 2022
@gruceo gruceo deleted the fix/FTI-2023 branch August 22, 2022 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants