karma-exchange-org/karma-exchange — pull request #40 by avaliani (2013-06-01 01:37:20+00:00)
Title: Fix duplicate automatic user creation (caused by parallel UI requests)

Fix duplicate automatic user creation (caused by parallel UI requests).

The user object now has a name based key that is based on the facebook uid.

**Notes:**

1. You will have to re-create all user objects.

2. Users created using "POST api/user" must have an explicit key OR an oAuth credential with the uid, provider, and token fields inited and the provider must be "facebook". The uid and token can be anything.

3. You may occasionally see "WARNING: Optimistic concurrency failure" in the dev server output. Don't worry. That's just a warning. Objectify transparently retries on contention. The contention happens both at user creation and at credential update. This is because the UI makes parallel requests and they therefore contend with each other.