Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting one user flushes the whole entity cache for users #6833

Open
indigoxela opened this issue Jan 17, 2025 · 1 comment · May be fixed by backdrop/backdrop#4995
Open

Deleting one user flushes the whole entity cache for users #6833

indigoxela opened this issue Jan 17, 2025 · 1 comment · May be fixed by backdrop/backdrop#4995

Comments

@indigoxela
Copy link
Member

indigoxela commented Jan 17, 2025

Description of the bug

Deleting a user should only affect the entity cache of that particular user, not flush everything as a whole.

This is a real pain point if your site has loads and loads of users and their profiles have lots of fields. Deleting one user makes the site (at least related pages) slow for a while.

Steps To Reproduce

  1. Generate or create some users
  2. Create a view of rendered users
  3. Visit that views page - that's to trigger entity cache creation for all of them
  4. Inspect Database table cache_entity_user - it should now be populated
  5. Go to admin/people, pick one user
  6. Cancel that single account - make sure you choose "Delete the account and its content"

Actual behavior

Inspect the database - the whole cache_entity_user table is empty.

Expected behavior

One row from the cache removed, the other ones untouched.

Additional information

  • Backdrop CMS version: discovered in 1.29.2, but is reproducible in latest dev
@indigoxela
Copy link
Member Author

It turned out, the solution's actually simple. Everything's in place in function user_delete_multiple(), only the parameter for the UIDs to delete was missing.

A PR is available for testing and review.

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

Successfully merging a pull request may close this issue.

1 participant