Skip to content

[Bug]: IllegalDurableOperationException when context validation fails #455

@zhongkechen

Description

@zhongkechen

Expected Behavior

A validation exception IllegalStateException should be thrown when context validation fails

Actual Behavior

IllegalDurableOperationException is thrown, which means critical errors usually caused by SDK or backend bugs

Steps to Reproduce

call step.get inside another step

public class OrderProcessor extends DurableHandler<Order, OrderResult> {

    @Override
    protected OrderResult handleRequest(Order order, DurableContext ctx) {
        var step1 = ctx.stepAsync("reserve-inventory", Reservation.class, 
            stepCtx -> inventoryService.reserve(order.getItems()));

        var step2 = ctx.step("process-payment", Payment.class,
            stepCtx -> {
                  step1.get(); <- throws an IllegalStateException exception
        });



    }
}

SDK Version

any

Java Version

17+

Is this a regression?

No

Metadata

Metadata

Assignees

Labels

BREAKINGSomething that is going to break existing usersbugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

Status
Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions