Skip to content

[1.x & 2.x] Discussion Metadata Stale after GDPR Erasure Request processed in deletion mode #5010

Description

@DavideIadeluca

Current Behavior

When GDPR Deleting a user, posts are bulk deleted like this:

public function delete(): void
{
Post::query()->where('user_id', $this->user->id)->delete();
}

Bulk deletion like this skips over the events needed to keep the discussions in sync and retain data integrity

Steps to Reproduce

  1. Create a new test user
  2. Start a few discussions, reply to some other discussions
  3. Request GDPR Erasure as that testing user
  4. Confirm the erasure request by that testing user
  5. Process the erasure request as an admin

Expected Behavior

Flarum Events should be dispatched (dispatchEventsFor()) which in turn would get listened to by the DiscussionMetadataUpdater.

Screenshots

No response

Environment

  • Flarum version: 1.8.17
  • Website URL: n.a.
  • Webserver: n.a.
  • Hosting environment: n.a.
  • PHP version: 8.3.32
  • Database 10.11.15 MariaDB
  • Browser: n.a.

Output of php flarum info

No response

Possible Solution

No response

Additional Context

I didn't test this locally against the 2.x version, however the implementation is the same there. Changing this behaviour is a technically a breaking change and ideally is done just for the 2.x branch, before 2.0.0 stable is released.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions