"PanicError: Cannot assign ActivityProxy" while running workflow containing signal methods

Hi all,

I get a PanicError while running workflow containing signal methods.
Full error text:

PanicError: Cannot assign Temporal\Internal\Workflow\ActivityProxy to property App\Workflow\GenerationWorkflow::$generateActivity of type App\Activity\GenerateActivityInterface (type: TypeError, retryable: true) 
process event for default [panic]:
github.com/temporalio/roadrunner-temporal/workflow.(*process).OnWorkflowTaskStarted(0xc000a9f1d0, 0xc000838900?)
	github.com/temporalio/roadrunner-temporal@v1.3.4/workflow/workflow.go:159 +0x2cb
go.temporal.io/sdk/internal.(*workflowExecutionEventHandlerImpl).ProcessEvent(0xc00000c8b8, 0xc0008e7400, 0x20?, 0x1)
	go.temporal.io/sdk@v1.14.0/internal/internal_event_handlers.go:815 +0x203
go.temporal.io/sdk/internal.(*workflowExecutionContextImpl).ProcessWorkflowTask(0xc000472000, 0xc00014f2c0)
	go.temporal.io/sdk@v1.14.0/internal/internal_task_handlers.go:878 +0xca8
go.temporal.io/sdk/internal.(*workflowTaskHandlerImpl).ProcessWorkflowTask(0xc000b520b0, 0xc00014f2c0, 0xc00093b350)
	go.temporal.io/sdk@v1.14.0/internal/internal_task_handlers.go:727 +0x485
go.temporal.io/sdk/internal.(*workflowTaskPoller).processWorkflowTask(0xc000b32410, 0xc00014f2c0)
	go.temporal.io/sdk@v1.14.0/internal/internal_task_pollers.go:284 +0x2cd
go.temporal.io/sdk/internal.(*workflowTaskPoller).ProcessTask(0xc000b32410, {0x15a86a0?, 0xc00014f2c0?})
	go.temporal.io/sdk@v1.14.0/internal/internal_task_pollers.go:255 +0x6c
go.temporal.io/sdk/internal.(*baseWorker).processTask(0xc000830000, {0x15a8260?, 0xc0008128b0})
	go.temporal.io/sdk@v1.14.0/internal/internal_worker_base.go:398 +0x167
created by go.temporal.io/sdk/internal.(*baseWorker).runTaskDispatcher
	go.temporal.io/sdk@v1.14.0/internal/internal_worker_base.go:302 +0xb5

Here is the workflow interface code:

use Temporal\Workflow\SignalMethod;
use Temporal\Workflow\WorkflowInterface;
use Temporal\Workflow\WorkflowMethod;

#[WorkflowInterface]
interface GenerationWorkflowInterface
{
    #[WorkflowMethod]
    public function generate(string $config, int $bidFactor);

    #[SignalMethod]
    public function pause();

    #[SignalMethod]
    public function resume();
}

Code of the workflow implementation:

use App\Activity\GenerateActivityInterface;
use App\Services\Timer;
use Carbon\CarbonInterval;
use Temporal\Activity\ActivityOptions;
use Temporal\Workflow;

class GenerationWorkflow implements GenerationWorkflowInterface
{
    private GenerateActivityInterface $generateActivity;
    private Timer $timer;

    public function __construct()
    {
        $this->timer = new Timer();

        $this->generateActivity = Workflow::newActivityStub(
            GenerateActivityInterface::class,
            ActivityOptions::new()
                ->withStartToCloseTimeout(CarbonInterval::seconds(30))
        );
    }

    public function generate(string $config): \Generator
    {
        yield $this->generateActivity->generate($config);
    }

    public function pause()
    {
        $this->timer->pause();
    }

    public function resume()
    {
        $this->timer->resume();
    }
}

If I remove signal methods pause() and resume() from GenerationWorkflow and GenerationWorkflowInterface, the worflow runs fine without any errors. But with these methods I get PanicError right after workflow start (even if I’m not sending any signals to this workflow). Can you help me, what am I doing wrong? Thanks in advance!

Hey Inessa_M :wave:

Could you please update PHP-SDK and RoadRunner to the latest stable versions?

Hi!

Due to PHP limitations he activity proxy does not implements your interface. Remove type from your workflow property and it should work. IDE suggestions should still work.

Thanks @Wolfy-J , @rustatian ! I removed type from my workflow property declaration and it works fine.