Request abort behavior during long-running Filament Actions
0 reputation · 21 Oct 2024, 02:08 UTC
Filament actions execute synchronously within the Livewire request lifecycle. When an action triggers a long-running process, the server-side PHP execution is governed by the web server and max_execution_time settings rather than framework-level constraints.
A specific concern arises when a user navigates away from the page or closes the browser while a Filament Action is still processing. While the Livewire connection is severed, the server-side process may continue to execute until completion or a system timeout occurs, as there is no native cancellation token passed to the action logic.
For processes offloaded to Laravel queues, Filament provides notification helpers, but it does not offer a standardized UI mechanism to track job progress or trigger a cancellation request from the frontend.
- Does Filament v3 provide a mechanism to detect a Livewire disconnection within a synchronous Action to stop execution?
- Is there a documented way to implement a user-initiated cancellation for actions that have been dispatched to the queue?