Deleting an user, deletes all existing flags on the website

Created on 16 August 2022, about 2 years ago
Updated 25 January 2023, over 1 year ago

Problem/Motivation

For a few months no, ALL my flags existing on the website, being node flags or user flags got deleted with no apparent reason. Nothing in the logs or whatsoever. Today I finally found out that when I delete a user on the website and check "Delete the account and its content.", all flags on the website get deleted, even if that user never used a flag or got flagged.

Steps to reproduce

  1. Install Flags and create a flag on any entity bundle
  2. Create some flags on entities
  3. Create a user
  4. Delete the newly created user
  5. All existing flags in the system are gone

Proposed resolution

Preferred behavior: only delete flags the user is related to: delete flags the user self made on enitities and delete flags on the user itself (for user entity bundles).

🐛 Bug report
Status

Active

Component

Flag core

Created by

🇧🇪Belgium apoc1

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India arun.testing3

    I was not able to reproduce the issue with with flag 8.x-4.x-dev and Group module 8.x-1.5 enabled. The flags of the deleted user are removed when user is deleted.

  • 🇧🇪Belgium apoc1

    I went into the database to see in which way Group entities and Flags are connected in any way and use that as a starting point to dive into the code, but with no luck. I lack time to debug this and ended up just disabling accounts instead of deleting them for the time being.

    Anyhow, I think there should be no situation that all existing flags on a system get deleted, by just deleting an user account. So speaking for Flag, this is something that should be thought about.

Production build 0.71.5 2024