Thank you for providing all the details on this matter! After doing some research, the behaviour that you are seeing does rarely occur with search queries with user-defined attributes under the /api/v2/users endpoint, which should be the result of timeouts. I am uncertain why the data remains consistently wrong fro about three days as you’ve mentioned, but can you please perform the search using the following endpoints and let us know if the deleted user still appears:
The above endpoints are known as immediately consistent and searches using these endpoints reflect the results of all successful write operations. I can recommend our documentation on User Search Best Practices which outlines some useful tips to overcome such data irregularities.
Let us know if the user still appears when running the search through the mentioned endpoints. If that is the case, please let us know:
was the user deleted manually from the Dashboard, or via the Management API?
was the user Auth0 sourced, or was it external ( either a Social user or brought from an external directory)?
That deleted user is indeed not available from /v2/users/{id} or /v2/users-by-email .
It’s mostly Welcome to Auth0 Docs - Auth0 Docs where the user is ‘stuck’. It’s shouldn’t be critical, just mostly a bit odd to leak the account in there.
For more info,
The user was first deleted from the Management API.
It’s an Auth0 sourced user. Created via the Management API into the ‘Username-Password-Authentication’ database.
A small update, the ghost user is still trapped in that search index. That account is only found from querying /api/v2/users?q=… but not with /v2/users-by-email
It appears that the behaviour remains consistent in this case and you are able to use /v2/users-by-email in order to work with more reliable, up to date information for any critical operations. In case this can be a possibility for you, it might be worth trying to delete the entire database the user was part of, then integrate it again and bring back all the users, this should erase all data related to the DB, including the user still appearing.
Thank you for reporting this strange issue, have a great one!
Gerald