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

Runtime function args fixes and defaults changes (#681)

Update runtimes walletsUpdate ledger updates to false
Fix Lua groupUpdate open argument parsing

Resolves #679
parent 86ec32a1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Improve email import semantics when linking social accounts.
- Log IAP provider API response payload when non 200 status code is returned.
- Better handling of storage operations where OCC is not required.
- Default ledger updates to false in JS and Lua runtimes `walletsUpdate` functions.

### Fixed
- Fix log level in Lua runtime log calls which use logger fields.
@@ -23,6 +24,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Add missing "environment" to JS ValidatedPurchases results.
- Fix typos in error messages referencing empty input values.
- Fix scale of exported time and latency metrics.
- Fix Lua groupUpdate function incorrect parsing of 'open' argument.

## [3.5.0] - 2021-08-10
### Added
+1 −1
Original line number Diff line number Diff line
@@ -3056,7 +3056,7 @@ func (n *runtimeJavascriptNakamaModule) walletUpdate(r *goja.Runtime) func(goja.
			}
		}

		updateLedger := true
		updateLedger := false
		if f.Argument(3) != goja.Undefined() {
			updateLedger = getJsBool(r, f.Argument(3))
		}
+2 −2
Original line number Diff line number Diff line
@@ -4312,7 +4312,7 @@ func (n *RuntimeLuaNakamaModule) walletUpdate(l *lua.LState) int {
		}
	}

	updateLedger := l.OptBool(4, true)
	updateLedger := l.OptBool(4, false)

	results, err := UpdateWallets(l.Context(), n.logger, n.db, []*walletUpdate{{
		UserID:    userID,
@@ -6762,7 +6762,7 @@ func (n *RuntimeLuaNakamaModule) groupUpdate(l *lua.LState) int {
	openV := l.Get(8)
	var open *wrapperspb.BoolValue
	if openV != lua.LNil {
		open = &wrapperspb.BoolValue{Value: l.OptBool(7, false)}
		open = &wrapperspb.BoolValue{Value: l.OptBool(8, false)}
	}

	metadataTable := l.OptTable(9, nil)