filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
17.59k stars 2.75k forks source link

When using QueryBuilder with Actions memory exhausts almost instantly #12554

Open Sprunkas opened 4 months ago

Sprunkas commented 4 months ago

Package

filament/filament

Package Version

v3.2.72.0

Laravel Version

v11.5.0

Livewire Version

v3.4.11

PHP Version

PHP 8.3.4

Problem description

When clicking second time "View" in "Products" menu table after QueryBuilder filter is applied I get "Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)". Even tried to increase memory limit to 2 GB, execution time to 10 min., but still didn't helped.

Expected behavior

It should open modal just like it opens first time, without a lot of memory consumption and etc.

Steps to reproduce

  1. Add Tables\Actions\ViewAction::make(), in ProductResource table method inside actions([])
  2. Open "Products" menu
  3. Apply any QueryBuilder filter
  4. Click "View" button to open modal
  5. Close modal
  6. Click again "View" button to open modal

Reproduction repository

https://github.com/Sprunkas/filament-demo

Relevant log output

No response

Donate 💰 to fund this issue

Fund with Polar

donnyxray commented 4 months ago

I experience something very similar:

I then have to "fix" it by manually appending GET parameters to disable the filter.

alexmanase commented 3 months ago

I started to investigate the problem and it seems that after pressing "View Action" the query with the selected filter is run over and over. In this way it creates an infinite loop.

https://github.com/filamentphp/filament/assets/10696975/fd313a35-c4eb-410e-9060-25c87e96570e

I will be still looking into the issue.