Skip to content

Document that auth.deleteUsers() does not trigger auth.user().onDelete() in the docstring #2928

Open
@th0rgall

Description

@th0rgall

[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:

* 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.
(which is used to generate the API reference version at https://firebase.google.com/docs/reference/admin/node/firebase-admin.auth.baseauth#baseauthdeleteusers)

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions