question

robert avatar image
robert asked

Delete all test users

Short question, while doing our automatic tests we created more than 300 user and let them play automatically. We now try to get rid of all of them. Whats the best way to do this? (hopefully don't having to call DeleteUser manually for each and every user...) Thanks!

p.s.: A "Delete user" button and a way to delete all users within a specific segment right from the dashboard would awesome. (this way we could also remove all users which invalid statistics, cheating users, etc...)

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

For now, I would recommend using a Task, assuming you can cleanly Segment that set of users - just have it call a Cloud Script that uses Server/DeleteUsers on the current player ID.

7 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

robert avatar image robert commented ·

Hmm, looks like DeleteUsers doesn't really delete the user but just resets statistics and account links. ResetUsers (which would also remove the inventory) can't be used on users with no username (as ResetUsers requires a username).

So, how can we get rid of test accounts? Such accounts may contain invalid data which could cause many troubles when running actions on all users in a segment for instance.

0 Likes 0 ·
robert avatar image robert robert commented ·

Making a function to "manually delete" a player and its inventory doesn't work because of cloud script method execution time limit of 1 seconds. not possible to iterate through inventory and remove each and every item instance.

0 Likes 0 ·
brendan avatar image brendan robert commented ·

The DeleteUsers call is designed to remove all custom information from the player account - it does not delete the PlayFab ID from the service, as that would cause problems for all the existing references to that ID, such as PlayStream data. I do see that deleted accounts may still be in Segments - we'll add a backlog item to add a flag to deleted accounts and ensure that they're not considered part of any segment.

0 Likes 0 ·
robert avatar image robert commented ·

Sounds good. And what is the preferred way to clear the inventory for all players? (iterating through the items via a cloud script function doesn't work because of time limit.) We could remove just one item at a time and call the task 100 times for all players?

0 Likes 0 ·
brendan avatar image brendan robert commented ·

No, trying to call something over and over all at once for a player would result in hitting rate limiting, which would be bad. Right now, the "clear all items from inventory" option would be by using ResetUsers. What is the scenario you have though - why do you need to remove the items from the player?

0 Likes 0 ·
robert avatar image robert commented ·

Beside that, I can understand that deleting users can cause problems because of still existing references. But I guess every developer runs into this situation. You tested a lot while developing and are now ready to release. One would like to release with a clean database. no users, no play stream events, no purchase history, everything just cleared. I guess something like this should be possible rather easy. (optionally I could create another title, reconfigure everything there and remove the old title. (it this is possible))

0 Likes 0 ·
brendan avatar image brendan robert commented ·

Actually, most developers use a separate Title ID during development, so that they have, as you say, a clean starting point for their live title.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.