Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleteUsers(uids: string[]) Not Working #2419

Open
aress31 opened this issue Jan 4, 2024 · 1 comment
Open

deleteUsers(uids: string[]) Not Working #2419

aress31 opened this issue Jan 4, 2024 · 1 comment
Assignees

Comments

@aress31
Copy link

aress31 commented Jan 4, 2024

deleteUsers is only deleting the first entry of the provided array of uid, see the following:

  • Relevant code snippet:

    --- SNIP ---
      if (httpMethod === "DELETE") {
            const { id } = event.queryStringParameters;
            if (!id) return handleError(new Error("Please provide an id."), 405);
    
            const uids = id.split(",");
            return handleDeleteRequest(tenantAuth, uids);
          }
    --- SNIP ---
    
    const handleDeleteRequest = async (tenantAuth, uids) => {
      try {
        console.log("handleDeleteRequest -> uids:", uids);
        const deleteUserResults = await tenantAuth.deleteUsers(uids);
    
        return {
          body: JSON.stringify({ results: deleteUserResults }),
          headers: { "Content-Type": "application/json" },
          statusCode: 200,
        };
      } catch (error) {
        return handleError(error);
      }
    };
  • uids value:

    handleDeleteRequest -> uids: [ 'cbHxLH4TtKN8tREDACTED', ' PLrrHeqlphcHP1REDACTED' ]
    Response with status 200 in 855 ms.
    
  • Server's response:

    {"results":{"failureCount":0,"successCount":2,"errors":[]}}

Although success count shows 2 when going to the console only the first user is deleted. It seems that this function is buggy...

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants