From 22ce531e3cbc6ca27269ca5b1203f4a940a5accf Mon Sep 17 00:00:00 2001 From: CicadaCinema <52425971+CicadaCinema@users.noreply.github.com> Date: Wed, 5 Jul 2023 22:04:11 +0000 Subject: [PATCH] allow numeric usernames less than MAX_INT64 --- clientapi/routing/register.go | 7 ------- sytest-whitelist | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go index 5235e9092..695425029 100644 --- a/clientapi/routing/register.go +++ b/clientapi/routing/register.go @@ -513,13 +513,6 @@ func Register( return handleGuestRegistration(req, r, cfg, userAPI) } - // Don't allow numeric usernames less than MAX_INT64. - if _, err = strconv.ParseInt(r.Username, 10, 64); err == nil { - return util.JSONResponse{ - Code: http.StatusBadRequest, - JSON: spec.InvalidUsername("Numeric user IDs are reserved"), - } - } // Auto generate a numeric username if r.Username is empty if r.Username == "" { nreq := &userapi.QueryNumericLocalpartRequest{ diff --git a/sytest-whitelist b/sytest-whitelist index 492c756ba..9cdcbe8a6 100644 --- a/sytest-whitelist +++ b/sytest-whitelist @@ -709,6 +709,7 @@ PUT /rooms/:room_id/redact/:event_id/:txn_id is idempotent Unnamed room comes with a name summary Named room comes with just joined member count summary Room summary only has 5 heroes +registration is idempotent, without username specified registration is idempotent, with username specified Setting state twice is idempotent Joining room twice is idempotent