-
Notifications
You must be signed in to change notification settings - Fork 401
Open
Labels
Description
[REQUIRED] Step 2: Describe your environment
- Operating System version: NA
- Firebase SDK version: 13.4.0
- Firebase Product: auth (node.js admin sdk)
- Node.js version: 20
- NPM version: NA
[REQUIRED] Step 3: Describe the problem
The deleteUsers() API does not trigger auth.user().onDelete() function calls for each individually deleted user.
This was unexpected for me, and the issue here is that this behavior was not documented in the place where I looked: the function docstring.
After firebase/firebase-functions#860, I can see that this behavior was documented here https://firebase.google.com/docs/auth/admin/manage-users#delete_multiple_users
However, it is not documented on the actual function docstring:
firebase-admin-node/src/auth/base-auth.ts
Lines 456 to 469 in 3c2cb9f
* Deletes the users specified by the given uids. | |
* | |
* Deleting a non-existing user won't generate an error (i.e. this method | |
* is idempotent.) Non-existing users are considered to be successfully | |
* deleted, and are therefore counted in the | |
* `DeleteUsersResult.successCount` value. | |
* | |
* Only a maximum of 1000 identifiers may be supplied. If more than 1000 | |
* identifiers are supplied, this method throws a FirebaseAuthError. | |
* | |
* This API is currently rate limited at the server to 1 QPS. If you exceed | |
* this, you may get a quota exceeded error. Therefore, if you want to | |
* delete more than 1000 users, you may need to add a delay to ensure you | |
* don't go over this limit. |
I would have preferred to see the same warning there, since this is what appears in IDEs when you may be poking around for a bulk version of deleteUser()
.