add coverage for removing all user settings on deletion + test coverage#24099
add coverage for removing all user settings on deletion + test coverage#24099nathangavin merged 39 commits into5.x-devfrom
Conversation
chippison
left a comment
There was a problem hiding this comment.
I've checked the code and done some functional tests, overall it everything works as intended. Deleting a user does remove the settings from the DB
There are a couple of edge case issues codex found though:
[P1] User deletion can leave legacy per-user data behind when one observer throws
Basically, if a plugin throws an exception when deleting a user, it could leave some data behind and not clean it up
- Was able to recreate this by creating a local plugin that throws exception on UserDelete
- Codex recommendations (you can just use this to get a starting point):
- Add direct legacy cleanup in deleteUserOptions() for MobileMessaging + ProfessionalServices keys (smallest blast radius).
- Keep event-based cleanup, but isolate observer failures per callback for this event path.
[P2] Migration strategy for ProfessionalServices scales poorly with user count
- wasn't really able to recreate this one, but seems like some DB query optimisation needed
- Codex recommendations: (you can just use this to get a starting point):
- Load ProfessionalServices.DismissedWidget.% once, group by login in PHP, then write/delete once.
- Keep logic but batch by login chunks with tighter SQL (still more churn than option 1).
|
I have checked the changes and it looks good from my end.
|
sgiehl
left a comment
There was a problem hiding this comment.
Didn't have time for any testing and only performed a rough code review
sgiehl
left a comment
There was a problem hiding this comment.
Tried doing a more detailed review now and left some further comments around possible improvements/fixes.
sgiehl
left a comment
There was a problem hiding this comment.
some last comments, afterwards that should be good to go.
Description
Please include a description of this change and which issue it fixes. If no issue exists yet please include context and what problem it solves.
fixes #23672
Checklist
Review