GDPR and account lifecycle
The UserDataPurger service reacts to Drupal's own user deletion/cancellation hooks; there is no separate configuration for this behavior.
- Full account deletion (
hook_user_delete, fired whenever a user entity is deleted regardless of the cancellation method used to get there): every row keyed by that uid is deleted fromai_metering_usage,ai_metering_rollup, andai_metering_quota. This is a right-to-erasure purge, not an anonymization. - Account cancellation with the "Delete the account and make its content belong to the Anonymous user" method (
hook_user_cancel, methoduser_cancel_reassignonly; the other cancellation methods leave metering data untouched): usage rows are reassigned to uid 0. Rollup rows are folded into the matching anonymous-user rollup grain (same month, provider, model, operation) by summing their counters when one already exists, or simply reassigned when it doesn't. Quota rows are always deleted outright in this path since a monthly budget is inherently personal and has no meaningful anonymous equivalent.
Both operations invalidate the ai_metering_usage and ai_metering_quota cache tags afterward so dashboards and the personal usage surfaces reflect the change immediately.