Status Update
Comments
ra...@google.com <ra...@google.com> #2
Thank you for reporting this behavior I have forwarded this internally.
tc...@gmail.com <tc...@gmail.com> #3
I believe this bug is the same as this one:
There is some additional information on the other bug report:
Please Note: This issue ONLY EXISTS when
showDeleted: true
In the case where
showDeleted: false
, thequery
parameters work fine, but whenshowDeleted: true
, allquery
parameters are ignored and the entire list of deleted users is returned (up to the maximum number of responses returnable within a given page).The byproduct of this is that if you are trying to find a particular deleted user account by email address, you have to fetch ALL deleted users (potentially thousands of them over several pages of requests and multiple minutes), and then use client side code to filter the responses.
Adding
projection:full
has no impact on this behavior (as was suggested further up in this thread)The documentation is written as follows:
showDeleted: If set to true, retrieves the list of deleted users. (Default: false)
So while the behavior of
showDeleted:true
does arguably reflect the functionality as documented, (the ENTIRE UNFILTERED list of deleted users is returned), it would certainly be preferable if this option could be used in conjunction with, and not instead of thequery
parameter.In our case, before creating a new account, we want to first check to see if an existing account with that same email address was recently deleted. If such an account does exist, we want to restore that account instead of creating a brand new account. This is effectively impossible to do however, as it requires that we sift through the entire list of all deleted accounts any time we go to create a new account. As a university, it is not uncommon for us to have 5,000+ accounts in the trash at any given time, and sifting through all 5,000 accounts during every account creation operation simply isn't viable.
Any resolution on this matter is appreciated.
Description
When listing users with the directory api if the parameter showDeleted = true the query parameter does not apply.
A small code sample that reliably reproduces the issue. The sample should run as-is or with minimal setup, without external dependencies.
Reproducible from the Try This API on the API documentation.
What steps will reproduce the problem?
1. Go to
2. Set showDeleted = true
3. Set Query to email = 'user@domain.com'
What is the expected output? What do you see instead? If you see error messages, please provide them.
Expected output is 0 results. There are no matches to the provided query parameter.
Actual results are a list of recently deleted users.
Please provide any additional information below.
If I change the query to, email = one of the recently deleted users, the results are the same. All recently deleted users are listed but it is expected that the 1 user that matches should be returned.