Cell phone number is taken
The other day, I added a new line to our cell phone plan... and took the new phone home. They said it should be active soon.
When I turned the phone on, it still hadn't been connected. I called the number which was programmed into the phone... Someone else answered! Somehow they had assigned a number that was already in use. I wonder if their database has a race condition.
Anyway, we haven't gotten to the real wtf yet. I went back into the store and explained the whole situation to the guy behind the counter. He seemed to understand, and called up the people who actually do all the work, explained it pretty well... and the person on the phone asked him for the number so they could look up the phone and change it. He rattled it off... and the the person on the phone said: "That doesn't belong to this customer..."
Hello? That's exactly why I was there! Of course that number isn't going to lead to my account!
I gave them my main phone number which found the correct account which had the phone listed... and they changed the phone number by incrementing it by one. Which is why I suspect their number lookup has a race condition...
Maybe just a buggy "getNextNumber" code and you've hit the upper limit of a range, that this office was allowed to assign?
[quote user="viraptor"]Maybe just a buggy "getNextNumber" code and you've hit the upper limit of a range, that this office was allowed to assign?
Is that somehow less of a WTF? I mean, a function that instead of throwing, say, an exception when it cannot complete its task, returns broken data instead?
I would tend to agree with the OP though, that this is likely a race condition.
Is that somehow less of a WTF?
Not at all! It was just a wild guess I've been doing new phone number generator lately and I think it would be very hard to hit race condition there... on the other hand, it's TDWTF, so...
You don't get some random number to check... you've got a range to choose from, so it's typically "enable/disable (update) next id" thing, rather than insert/delete. In normal case, you can do it in 1, or 2 steps. On the other hand, running into end of range and assigning the same number twice (reassigning second time) seems more likely.
Though - not my code - no idea what's the real problem.