@@ -45,6 +45,7 @@ import {
4545 getFunctionName ,
4646 getActionPaths ,
4747 createActionsProxy ,
48+ EXECUTION ,
4849} from './utils'
4950import {
5051 operatorStarted ,
@@ -389,6 +390,7 @@ export class Overmind<ThisConfig extends IConfiguration>
389390 private createExecution ( name , action , parentExecution ) {
390391 if ( IS_PRODUCTION ) {
391392 return ( {
393+ [ EXECUTION ] : true ,
392394 parentExecution,
393395 getMutationTree : ( ) => {
394396 return this . proxyStateTree . getMutationTree ( )
@@ -399,6 +401,7 @@ export class Overmind<ThisConfig extends IConfiguration>
399401
400402 const mutationTrees : any [ ] = [ ]
401403 const execution = {
404+ [ EXECUTION ] : true ,
402405 actionId : this . actionReferences . indexOf ( action ) ,
403406 executionId : this . nextExecutionId ++ ,
404407 actionName : name ,
@@ -474,6 +477,11 @@ export class Overmind<ThisConfig extends IConfiguration>
474477 private createAction ( name , action ) {
475478 this . actionReferences . push ( action )
476479 const actionFunc = ( value ?, boundExecution ?: Execution ) => {
480+ // Developer might unintentionally pass more arguments, so have to ensure
481+ // that it is an actual execution
482+ boundExecution =
483+ boundExecution && boundExecution [ EXECUTION ] ? boundExecution : undefined
484+
477485 if ( IS_PRODUCTION || action [ IS_OPERATOR ] ) {
478486 const execution = this . createExecution ( name , action , boundExecution )
479487 this . eventHub . emit ( EventType . ACTION_START , {
0 commit comments