Skip to content

fix(delegation): clean delegations on user deletion#13147

Merged
hamza221 merged 2 commits into
mainfrom
fix/delegation/clean-user-deletion
Jun 23, 2026
Merged

fix(delegation): clean delegations on user deletion#13147
hamza221 merged 2 commits into
mainfrom
fix/delegation/clean-user-deletion

Conversation

@hamza221

Copy link
Copy Markdown
Contributor

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
@hamza221

Copy link
Copy Markdown
Contributor Author

/backport to stable5.10

return $this->findEntity($qb);
}

public function deleteByUserId(string $userId): void {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not covered by any test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should I write integration tests for the mapper ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes

@hamza221 hamza221 enabled auto-merge (squash) June 23, 2026 15:54
@hamza221 hamza221 force-pushed the fix/delegation/clean-user-deletion branch from 051990d to b06d3e9 Compare June 23, 2026 16:52
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

DelegationMapper gains a new deleteByUserId(string $userId): void method that issues a DELETE query filtered by user_id. UserDeletedListener is updated to import and inject DelegationMapper, then calls deleteByUserId inside handle() alongside the existing account and text-block deletions. A new DelegationMapperTest integration test class covers delegation lookup, owner resolution, missing-record exceptions, and the new deletion method. UserDeletedListenerTest is updated to mock DelegationMapper and assert the new call in all existing test scenarios.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.55% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding delegation cleanup to user deletion, which is the core objective of the PR.
Description check ✅ Passed The description is minimal but not completely off-topic; it contains a standard AI usage checkbox, which is tangentially related to PR documentation conventions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f1fd5a32-4eb1-4b35-94b7-e195ef5ef64a

📥 Commits

Reviewing files that changed from the base of the PR and between e988c74 and b06d3e9.

📒 Files selected for processing (4)
  • lib/Db/DelegationMapper.php
  • lib/Listener/UserDeletedListener.php
  • tests/Integration/Db/DelegationMapperTest.php
  • tests/Unit/Listener/UserDeletedListenerTest.php

Comment thread lib/Listener/UserDeletedListener.php Outdated
Comment thread tests/Integration/Db/DelegationMapperTest.php Outdated
@hamza221 hamza221 disabled auto-merge June 23, 2026 17:17
@hamza221 hamza221 force-pushed the fix/delegation/clean-user-deletion branch from b06d3e9 to 1aa067b Compare June 23, 2026 17:21
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
@hamza221 hamza221 force-pushed the fix/delegation/clean-user-deletion branch from 1aa067b to f3de342 Compare June 23, 2026 17:25
@hamza221 hamza221 merged commit ef21807 into main Jun 23, 2026
43 checks passed
@hamza221 hamza221 deleted the fix/delegation/clean-user-deletion branch June 23, 2026 17:49
@backportbot

This comment was marked as resolved.

@ChristophWurst

Copy link
Copy Markdown
Member

/backport to stable5.10 please

@backportbot

This comment was marked as resolved.

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