#Action works fast but modal window hangs?

7 messages · Page 1 of 1 (latest)

spark flume
#
    ->action(function ($record) {
        $service = new MyService();
        $result = $service->myServiceClass($record->id);
        // dd($result); up to here is fast, the action is ready
        // then the modal window hangs also without Notification
         Notification::make()
         ...
    })
    ->requiresConfirmation(),```
does anyone have any ideas as to why this could be?
spare forumBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

spark flume
#

I have tried various solutions (cancel modal, redirect, refresh etc.) but nothing works. the modal just hangs and the job was actually finished quickly. is it better to do an asynchronous or background job?

atomic drift
#

Can you provide the whole code?

void linden
#

So if you remove everything after $result = $service->myServiceClass($record->id); the modal remains open?

spark flume
#

Yes, if i remove everything after, the modal remains open (also without modal, the action link hangs).
it hangs after this response within the myServiceClass:

    'query' => $receive_params,
    'allow_redirects' => TRUE,
    'timeout' => 10,
    'verify' => FALSE,
    'connect_timeout' => 5,
    'debug' => TRUE, 
    'headers' => [
        'User-Agent: curl / 7.81.0'
    ]
]);```
But the service is ready.
#

I think i found it: 'debug' => FALSE,