Fixed
Project:
AI Metering
Version:
1.0.0-beta1
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
6 Jul 2026 at 13:16 UTC
Updated:
7 Jul 2026 at 00:03 UTC
Jump to comment: Most recent
When a Drupal user is deleted, their AI usage history stays behind. There is no hook_user_cancel or hook_user_delete, so rows keyed by uid in ai_metering_usage and ai_metering_quota are orphaned and retained indefinitely - a GDPR right-to-erasure gap for a module aimed at enterprise governance.
Implement hook_user_cancel and hook_ENTITY_TYPE_delete() for users to delete that user's rows from both tables. Add a kernel test asserting the rows are gone after the user is removed.
Yes, AI was used to explore the issue.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #5
codeitwisely commented