fix: resolve P1 backend consistency issues
This commit is contained in:
+6
-1
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"container/heap"
|
||||
crand "crypto/rand"
|
||||
"errors"
|
||||
"math/rand"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -216,7 +217,11 @@ func replyCreateUser(s *Session, msg *ClientComMessage, rec *auth.Rec) {
|
||||
// Create user record in the database.
|
||||
if _, err := store.Users.Create(s.tenantID, &user, private); err != nil {
|
||||
logs.Warn.Println("create user: failed to create user", err, "sid=", s.sid)
|
||||
s.queueOut(ErrUnknown(msg.Id, "", msg.Timestamp))
|
||||
params := map[string]any(nil)
|
||||
if errors.Is(err, types.ErrDuplicate) && phoneRegistration {
|
||||
params = map[string]any{"what": "phone", "reason": "PHONE_ALREADY_REGISTERED"}
|
||||
}
|
||||
s.queueOut(decodeStoreError(err, msg.Id, msg.Timestamp, params))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user