filament icon indicating copy to clipboard operation
filament copied to clipboard

Looping Requisitions when filtering through Toggleable Columns in a Table

Open RivnatZille opened this issue 2 years ago • 16 comments

Package

filament/filament

Package Version

v2.12.16

Laravel Version

v9.14.0

Livewire Version

v2.10.5

PHP Version

8.0.2

Bug description

In my UserResource I have a Table that consists of up to 8 columns, with 5 of them being toggleable. Here's the code for the 5 toggleable ones: 4

Also, I have filters for 4 of these columns, excluding the teams. Here's the code for the filters: 5

Whenever I toggle on any of the toggleable columns and filter through any of them, there's a high chance that I'll trigger some sort of Requisition Loop, where the table will blink every few ms, and it'll keep updating itself. Here's a screenshot of how many requisitions I've got in just a few seconds after filtering through the table with the toggleable columns on: 3

When this bug happens, the only way to stop the requisition loop is to refresh the page, as un-filtering or toggling off the columns will still cause the loop to happen.

So far, the only solution I've found was to remove the Toggleable hook in these columns. This way, I can filter through them without any issues.

Also, at first the possible culprit was Laragon, but I'm testing it now with Docker and Laradock installed directly into WSL2, and the loop unfortunately still happens.

Thanks in advance for all the support given!

Steps to reproduce

Step 1. Toggle some or all of the columns on: 1

Step 2. Filter through any of the toggleable columns: 2

Step 3. In order to stop the loop, refresh the page.

It's also important to mention that the looping bug isn't happening all times, but I can reproduce it almost every time.

Relevant log output

No response

RivnatZille avatar Jul 06 '22 16:07 RivnatZille

Please set up a repo that I can use to reproduce this issue, with a database seeder

danharrin avatar Jul 06 '22 17:07 danharrin

Hello dan! Thanks for the very fast reply!

Sure! Here's the repo: https://github.com/graphiscomunicacao/lms-pro

Since the Admin Panel is in English, the UserResource is in the Navigation Group GERENCIAR USUÁRIOS, called Usuários

RivnatZille avatar Jul 06 '22 17:07 RivnatZille

I've also encountered this issue when toggling columns and then searching the table.

zepfietje avatar Aug 08 '22 10:08 zepfietje

@RivnatZille, I can't reproduce the issue anymore (also with your provided repository).

Could you check if the issue still occurs with the latest version of Filament?

zepfietje avatar Aug 10 '22 09:08 zepfietje

Maybe it's our new wire:key elements

danharrin avatar Aug 10 '22 10:08 danharrin

That's my thought as well, but not 100% sure.

I also tried reproducing with an older version of Filament, but maybe I missed something

zepfietje avatar Aug 10 '22 10:08 zepfietje

Didn't you experience this issue yourself in your own app?

danharrin avatar Aug 10 '22 10:08 danharrin

Uh yeah, I did. 😅 But it was locally so maybe I didn't pull in the right (broken) version today.

zepfietje avatar Aug 10 '22 10:08 zepfietje

Okay, finally I've been able to reproduce this issue again on the latest version of Filament.

zepfietje avatar Aug 11 '22 08:08 zepfietje

Having a really hard time reproducing this issue at the moment. Maybe it actually is fixed now. Since @RivnatZille hasn't replied, we could close this issue until someone (like me) runs into it again, @danharrin?

zepfietje avatar Aug 22 '22 14:08 zepfietje

Hi everyone!

Sorry I didn't answer earlier, I've been very busy working on another project, so I didn't had the time to test it out for these past weeks. I'll update Filament and try it out as soon as I can.

Thanks for taking a look at it!

RivnatZille avatar Aug 22 '22 14:08 RivnatZille

No problem, @RivnatZille. Let us know if you run into the problem again, then we'll reopen the issue. Will close it for now as I'm no longer experiencing the bug.

zepfietje avatar Aug 22 '22 15:08 zepfietje

Hey guys! First of all, thanks for all the replies on the issue. I was finally able test out the Filament project, and even with Filament's v2.15.32 version, I'm still able to reproduce the looping requisitions bug. I've followed the same steps as before, by toggling on some columns that are hidden by default, and right after that filtering by any random column. As soon as the table was filtered, the looping requisitions began again, requiring me to reload the page in order for it to stop.

RivnatZille avatar Aug 30 '22 13:08 RivnatZille

Hmm, was that with your reproduction repository you posted here?

I had difficulty reproducing the issue in my own project, but will reopen this issue if you're still experiencing it! 👍

zepfietje avatar Aug 30 '22 16:08 zepfietje

Yes, I was able to reproduce it with the repository that I've posted.

Thanks for reopening the issue!

RivnatZille avatar Aug 30 '22 16:08 RivnatZille

Hey there. I've just found this issue In the official demo (demo.filamentphp.com). The steps to reproduce it are:

  • Login
  • Go to Brands
  • Click a brand
  • Scroll to Products
  • Click the Toggle Columns button
  • Toggle Security stock or Publish Date on (they were off for me)
  • Sort the table (clicking in the column header) by any column
  • The loop starts

The loop stops with a reload or if any column is then turned on or off

I've made a GIF of this procedure you can see here (can't seem to embedd it): https://i.imgur.com/zCCBeTo.gif

I'm using Chrome 105.0.5195.127.

Hope this helps.

jfvoliveira avatar Sep 20 '22 20:09 jfvoliveira

Should be fixed by #4196. Please check in the next Filament version. Let me know either way.

danharrin avatar Sep 25 '22 20:09 danharrin

Hey Dan! I've updated Filament and tested out the tables many times, and wasn't able to reproduce the bug anymore! It's fixed!

Thank you so much! Cheers!

RivnatZille avatar Sep 28 '22 19:09 RivnatZille