Skip to content

Context Stop still executing next step #55

@VictorTBX

Description

@VictorTBX

Describe the bug
When I use the .stop() function of context, according to the audit, the code still executed the next step.

To Reproduce
Add two steps to an usecase
In the first step use ctx.stop() and return Ok() followed by it
In the second step add anything and return Ok() as well
Log the usecase auditTrail
Check that the second step was executed and both steps have the property "stopped":true

Expected behavior
When ctx.stop() is called, the next step should not be executed and the usecase should finish.

Audit Trail Json Example

"steps":[
         {
            "type":"step",
            "description":"Verify if parameters are valid",
            "return":{
               "Ok":""
            },
            "elapsedTime":"26019"
         },
         {
            "type":"step",
            "description":"Verify if cache exists",
            "return":"",
            "elapsedTime":"23959698",
            "stopped":true
         },
         {
            "type":"step",
            "description":"Get groups by user id",
            "return":{
               "Ok":""
            },
            "elapsedTime":"27913907",
            "stopped":true
         }
      ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions