As described in {T349503}, the `TempUserCreator::acquireName` method uses `SerialProvider::acquireIndex` in a way that assumes it will always return an integer that has never been used before. However, the documentation for this method says the index is instead `unlikely to be used again`.
As discussed at T349503, this means that the `TempUserCreator::create` and `TempUserCreator::acquireAndStashName` methods must handle the situation where an index is returned that has previously been used. This code currently causes issues because this assumption means that a user can be logged in to an already existing temporary account on a collision.
====Steps to replicate the issue
//These steps are aimed at a local testing wiki//
# Disable temporary account creation (if enabled)
# Run one of the following SQL:
## If using CentralAuth, run the SQL in 2A
## If not using CentralAuth, run the SQL in 2B
```lang=sql,name=2A: SQL for step 1 when using CentralAuth
SELECT uas_value FROM global_user_autocreate_serial WHERE uas_shard = 0;
```
```lang=sql,name=2B: SQL for step 1 when not using CentralAuth
SELECT uas_value FROM user_autocreate_serial WHERE uas_shard = 0;
```
3. Keep a track of the result of the query 2A or 2B. If query 2A or 2B returned no rows, then take this number as `1`.
# Create an account with the username that matches the temporary account format, using the number from step 3. This should usually be `*Unregistered X` where `X` is the integer from step 3, though the format will change with T349494.
# Log out of the new account
# Re-enable temporary account creation, with the `serialMapping` key defined with a value of `[ 'type' => 'plain-numeric', 'numShards' => 1 ]`
# Go to any page, and open the edit window.
# Make some changes and press save
**What happens?**:
TODO - Getting screenshots
**What should have happened instead?**:
TODO - Getting screenshots