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: Remove deleted resource from associated applications #1156

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

enjeck
Copy link
Contributor

@enjeck enjeck commented Jun 19, 2024

Fixes #1027

@enjeck enjeck added bug Something isn't working 3. to review Waiting for reviews labels Jun 19, 2024
@enjeck enjeck self-assigned this Jun 19, 2024
@blizzz
Copy link
Member

blizzz commented Jun 21, 2024

🤔 I thought we/I did it in the past 😕

lib/Db/ContextNodeRelationMapper.php Outdated Show resolved Hide resolved
Comment on lines +258 to +267
foreach ($nodeRelIds as $nodeRelId) {
$this->pageContentMapper->deleteByNodeRelId($nodeRelId);
$this->contextNodeRelMapper->deleteByNodeRelId($nodeRelId);
}
Copy link
Member

Choose a reason for hiding this comment

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

We can save the n+1 queries here by rather having methods that support multiple ids in an array and use an IN() sql statement. Might not be crucial here but generally a good pattern to follow for performance instead of doing queries in a loop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how to go about this 😕 😕

lib/Service/ContextService.php Outdated Show resolved Hide resolved
Signed-off-by: Cleopatra Enjeck M <patrathewhiz@gmail.com>
Signed-off-by: Cleopatra Enjeck M <patrathewhiz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working
Projects
Status: 🏗️ In progress
Development

Successfully merging this pull request may close these issues.

Remove deleted resource from associated Applications
3 participants