diff --git a/backend/v3/domain/command.go b/backend/v3/domain/command.go index 28887bba57..bc8f57ef2f 100644 --- a/backend/v3/domain/command.go +++ b/backend/v3/domain/command.go @@ -23,6 +23,7 @@ type Invoker interface { // CommandOpts are passed to each command // they provide common fields used by commands like the database client. +// Not thread safe because fields can change state during execution. type CommandOpts struct { DB database.QueryExecutor Invoker Invoker diff --git a/backend/v3/domain/invoke.go b/backend/v3/domain/invoke.go index caaac9450c..5948893b00 100644 --- a/backend/v3/domain/invoke.go +++ b/backend/v3/domain/invoke.go @@ -83,6 +83,7 @@ func newTraceInvoker(next Invoker) *traceInvoker { } // Invoke implements the [Invoker] interface. +// TODO(adlerhurst): properly handle call stack, currently you would always get the line of the invoker instead of the code func (i *traceInvoker) Invoke(ctx context.Context, command Commander, opts *CommandOpts) (err error) { ctx, span := tracer.Start(ctx, fmt.Sprintf("%T", command)) defer func() { @@ -109,6 +110,7 @@ func newLoggingInvoker(next Invoker) *loggingInvoker { } // Invoke implements the [Invoker] interface. +// TODO(adlerhurst): properly handle call stack, currently you would always get the line of the invoker instead of the code func (i *loggingInvoker) Invoke(ctx context.Context, command Commander, opts *CommandOpts) (err error) { logger.InfoContext(ctx, "Invoking command", "command", command.String())