mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-19 02:50:53 +01:00
speed up user.delete
user.delete calls `groups.leaveAllGroups` which calls rejectMembership with 500+ groups. This function then tries to remove the user from `group:<group>:pending` and `group:<group>:invited` sets so a total for 1k sets. You can't be invited or request membership to privilege groups so filter the groups before sending to rejectMembership
clearGroupTitleIfSet function tries to remove the group title from the user. It was only skipping privilege groups and registered-users, but unverified-users & verified users weren't added to the check
Messaging.leaveRooms, make a single call to isUserInRoom and passing an array of roomIds
In user.delete, check utils.isNumber(uid) once.
Call deleteVotes/deleteChats/revokeAllSessions in Promise.all
If user is local dont call activitypub.actors.remove(), this saves a db call to `await db.isSortedSetMember('usersRemote:lastCrawled', id);`