From 72562634ed547d157ba70a7710ecad1c168964a3 Mon Sep 17 00:00:00 2001 From: Simon Esposito Date: Thu, 14 Dec 2023 12:32:01 +0000 Subject: [PATCH] Increase storage index list max limit to 10000 (#1154) --- CHANGELOG.md | 1 + server/runtime_go_nakama.go | 4 ++-- server/runtime_javascript_nakama.go | 4 ++-- server/runtime_lua_nakama.go | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3822de3b7..a3d797ce91 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr ## [Unreleased] ### Changed - JS localcachePut now only accepts primitive types, other values will throw an error. +- Storage search index list max limit increased from 100 to 10000 results. ## [3.19.0] 2023-11-11 ### Added diff --git a/server/runtime_go_nakama.go b/server/runtime_go_nakama.go index e996222d88..45481d3fd2 100644 --- a/server/runtime_go_nakama.go +++ b/server/runtime_go_nakama.go @@ -2076,8 +2076,8 @@ func (n *RuntimeGoNakamaModule) StorageIndexList(ctx context.Context, callerID, return nil, errors.New("expects a non-empty indexName") } - if limit < 1 || limit > 100 { - return nil, errors.New("limit must be 1-100") + if limit < 1 || limit > 10_000 { + return nil, errors.New("limit must be 1-10000") } return n.storageIndex.List(ctx, cid, indexName, query, limit) diff --git a/server/runtime_javascript_nakama.go b/server/runtime_javascript_nakama.go index 784e2108eb..438af65d65 100644 --- a/server/runtime_javascript_nakama.go +++ b/server/runtime_javascript_nakama.go @@ -358,8 +358,8 @@ func (n *runtimeJavascriptNakamaModule) storageIndexList(r *goja.Runtime) func(g limit := 100 if !goja.IsUndefined(f.Argument(2)) && !goja.IsNull(f.Argument(2)) { limit = int(getJsInt(r, f.Argument(2))) - if limit < 1 || limit > 100 { - panic(r.NewTypeError("limit must be 1-100")) + if limit < 1 || limit > 10_000 { + panic(r.NewTypeError("limit must be 1-10000")) } } callerID := uuid.Nil diff --git a/server/runtime_lua_nakama.go b/server/runtime_lua_nakama.go index a493f2fd56..e41f6a5052 100644 --- a/server/runtime_lua_nakama.go +++ b/server/runtime_lua_nakama.go @@ -9978,8 +9978,8 @@ func (n *RuntimeLuaNakamaModule) storageIndexList(l *lua.LState) int { idxName := l.CheckString(1) queryString := l.CheckString(2) limit := l.OptInt(3, 100) - if limit < 1 || limit > 100 { - l.ArgError(3, "invalid limit: expects value 1-100") + if limit < 1 || limit > 10_000 { + l.ArgError(3, "invalid limit: expects value 1-10000") return 0 } callerID := uuid.Nil