Action always shows the previously viewed record in the modal
Hello guys,
I’m experiencing an issue in our production application using Filament 3 + Livewire:
Error description:
- When I click any Filament Action to view a record inside a modal, the component always shows the previously viewed record.
- Only after performing a full browser refresh (F5) does it display the correct record.
- On localhost everything works as expected. Suspicions already ruled out:
1. Laravel cache: ran
2. Session driver: tested both
3. Environment parity: Filament 3, and Livewire versions/configs identical between local and production.
4. Browser cache: cleared cookies, tested in incognito mode and across different browsers.
5. JavaScript / Livewire: no console errors; Livewire and Filament scripts load without failure.
6. Filesystem permissions:
There seems to be a failure in state synchronization of the Livewire component used by Filament between AJAX requests. The session in production (especially with the
- When I click any Filament Action to view a record inside a modal, the component always shows the previously viewed record.
- Only after performing a full browser refresh (F5) does it display the correct record.
- On localhost everything works as expected. Suspicions already ruled out:
1. Laravel cache: ran
php artisan cache:clear
, config:clear
, route:clear
, view:clear
and manually deleted storage/framework/cache
, sessions
, views
, and bootstrap/cache
.2. Session driver: tested both
SESSION_DRIVER=file
and database
(with sessions
table created via migration).3. Environment parity: Filament 3, and Livewire versions/configs identical between local and production.
4. Browser cache: cleared cookies, tested in incognito mode and across different browsers.
5. JavaScript / Livewire: no console errors; Livewire and Filament scripts load without failure.
6. Filesystem permissions:
storage/
and bootstrap/cache/
owned by www-data:www-data
, perms 775
.
Current suspicion:There seems to be a failure in state synchronization of the Livewire component used by Filament between AJAX requests. The session in production (especially with the
database
driver) or the authentication middleware may not be propagating the updated state, causing the component to “stick” to the previous record until a full page reload.
Thank you for any guidance or tips on specific logs/debugging techniques to capture component state across clicks.6 Replies
Hello, greetings to all.
I'm experiencing the same difficulties mentioned above.
I've been facing a problem in Filament regarding viewing/editing records through the Actions feature of tables that automatically generate forms within a Modal. For example, when I click on a record containing Ana's data, it opens the view or edit window with Ana's data correctly. Now, if I view Ana's data, close the modal, and click on another record to view Bruno's data, it still displays Ana's data. In other words, the record I open first stays in memory and doesn't change unless the page is reloaded. I've tried a lot of things, but nothing has changed. Could you help me?
My development environment: PHP 8.2.27, Laravel 11.41.3, Filament 3.3.34, and MariaDB 10.
Thank you for your attention.
Please make sure you didn’t publish any view files.
Hi I had the exact the same issue on table row modals
I have implemented a solution basically overriding the mountTableActions method. In my list view.
I will post the code a bit later when at my computer (on my phone rn) but it just clears the array containing the state. And then returns as normal.
Been meaning to submit a bug report but haven’t had a chance to test it on a fresh installation.
But interesting to see other ppl having the same issue
Thanks. I was thinking about overriding the table method to display on a page. Your idea seems better. Thanks, I'll be waiting!
basically just add this to resources/listXYZ for the panel. also doing something similar for custom pages. It just clears the array of mounted table actions. Still havent tested to see if this bug exists on a fresh filament install (I would guess not or else a lot more people would have this issue).
Edit: looks like a lot of ppl have this issue but I am swamped next couple of days will open bug report on Friday with example repo of no one else has
public function mountTableAction(string $name, ?string $record = null, array $arguments = []): mixed
{
$this->mountedTableActions = [];
return parent::mountTableAction($name, $record, $arguments);
}
Thank you, I will test it and give you feedback. Very grateful.
I'd like to thank @Dhru once again for his help. I'd tried many things, but nothing had worked. This tip he gave me worked and solved my problem. I copied this code snippet into three different places: the Edit page, the View page, and the RelationManager of each Resource where needed. I hope this error is fixed in new Filament versions. Thanks @Dhru .