Hi, I’ve noticed something weird in MontiAPM: the createUser
function seems to run _createUserCheckingDuplicates
with a blank username and email every time a user creates an account on my site.
Here’s the function in question [Github]:
_createUserCheckingDuplicates({ user, email, username, options }) {
const newUser = {
...user,
...(username ? { username } : {}),
...(email ? { emails: [{ address: email, verified: false }] } : {}),
};
// Perform a case insensitive check before insert
this._checkForCaseInsensitiveDuplicates('username', 'Username', username);
this._checkForCaseInsensitiveDuplicates('emails.address', 'Email', email);
const userId = this.insertUserDoc(options, newUser);
// Perform another check after insert, in case a matching user has been
// inserted in the meantime
try {
this._checkForCaseInsensitiveDuplicates('username', 'Username', username, userId);
this._checkForCaseInsensitiveDuplicates('emails.address', 'Email', email, userId);
} catch (ex) {
// Remove inserted user if the check fails
Meteor.users.remove(userId);
throw ex;
}
return userId;
}
But when I view this in MontiAPM, it’s showing these queries often take 1+ seconds (in some cases 10+ seconds), and the selectors are blank.
The user accounts are created without issue, but this seems to slow down my setup a little bit.
Anyone else seeing something similar?