Unverified Commit 72562634 authored by Simon Esposito's avatar Simon Esposito Committed by GitHub
Browse files

Increase storage index list max limit to 10000 (#1154)

parent c8d76761
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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)
+2 −2
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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