Commit 19d28274 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Update changelog and config defaults.

parent d25fa877
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Better handling of storage operations where OCC is not required.
- Default ledger updates to false in JS and Lua runtimes `walletsUpdate` functions.
- Build with Go 1.17.0 release.
- New config option to toggle Lua runtime error stacktraces returned to clients.
- Purchase validation functions now return a flag indicating if valid purchases are new or resubmitted.

### Fixed
- Fix log level in Lua runtime log calls which use logger fields.
+2 −2
Original line number Diff line number Diff line
@@ -765,7 +765,7 @@ type RuntimeConfig struct {
	EventQueueWorkers  int               `yaml:"event_queue_workers" json:"event_queue_workers" usage:"Number of workers to use for concurrent processing of events. Default 8."`
	ReadOnlyGlobals    bool              `yaml:"read_only_globals" json:"read_only_globals" usage:"When enabled marks all Lua runtime global tables as read-only to reduce memory footprint. Default true."` // Kept for backwards compatibility
	LuaReadOnlyGlobals bool              `yaml:"lua_read_only_globals" json:"lua_read_only_globals" usage:"When enabled marks all Lua runtime global tables as read-only to reduce memory footprint. Default true."`
	LuaApiStackTrace   bool              `yaml:"lua_api_stacktrace" json:"lua_api_stacktrace" usage:"Add the Lua stacktrace in the API response"`
	LuaApiStacktrace   bool              `yaml:"lua_api_stacktrace" json:"lua_api_stacktrace" usage:"Include the Lua stacktrace in error responses returned to the client. Default false."`
	JsEntrypoint       string            `yaml:"js_entrypoint" json:"js_entrypoint" usage:"Specifies the location of the bundled JavaScript runtime source code."`
}

@@ -826,7 +826,7 @@ func NewRuntimeConfig() *RuntimeConfig {
		EventQueueWorkers:  8,
		ReadOnlyGlobals:    true,
		LuaReadOnlyGlobals: true,
		LuaApiStackTrace:   true,
		LuaApiStacktrace:   false,
	}
}

+1 −4
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import (
	"github.com/heroiclabs/nakama/v3/social"
	"go.uber.org/atomic"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
	"google.golang.org/grpc/codes"
	"google.golang.org/protobuf/encoding/protojson"
	"google.golang.org/protobuf/proto"
@@ -2004,9 +2003,7 @@ func (r *RuntimeLua) Stop() {
}

func clearFnError(fnErr error, rp *RuntimeProviderLua, lf *lua.LFunction) error {
	if apiErr, ok := fnErr.(*lua.ApiError); ok &&
		(!rp.config.GetRuntime().LuaApiStackTrace || !rp.logger.Core().Enabled(zapcore.InfoLevel)) {

	if apiErr, ok := fnErr.(*lua.ApiError); ok && !rp.config.GetRuntime().LuaApiStacktrace {
		msg := apiErr.Object.String()
		if strings.HasPrefix(msg, lf.Proto.SourceName) {
			msg = msg[len(lf.Proto.SourceName):]