You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have a panel with 41 resources whenever I enter the edit, view or create page of the role resource it takes 10 seconds to load on my local machine, I kinda of tried to track down the issue in the package by commenting certain components and/or method calls, and I narrowed it down to the following method call to filter in the setPermissionStateForRecordPermissions function used to set the state for checkbox list component
if (in_array($operation, ['edit', 'view'])) {
if (blank($record)) {
return;
}
if ($component->isVisible() && count($permissions) > 0) {
$component->state(
collect($permissions)
/** @phpstan-ignore-next-line */
->filter(fn ($value, $key) => $record->checkPermissionTo($key)) // <= here is the slow part
->keys()
->toArray()
);
}
}
To Reproduce
Steps to reproduce the behavior:
I don't know how can you reproduce this amount of resources but if you have a large amount this method call increases the response time very much
Expected behavior
The response time should be that long
Screenshots
please complete the following information:
OS: Arch linux
Filament 3.2
Version 3.3
The text was updated successfully, but these errors were encountered:
Describe the bug
I have a panel with 41 resources whenever I enter the edit, view or create page of the role resource it takes 10 seconds to load on my local machine, I kinda of tried to track down the issue in the package by commenting certain components and/or method calls, and I narrowed it down to the following method call to filter in the setPermissionStateForRecordPermissions function used to set the state for checkbox list component
To Reproduce
Steps to reproduce the behavior:
I don't know how can you reproduce this amount of resources but if you have a large amount this method call increases the response time very much
Expected behavior
The response time should be that long
Screenshots
please complete the following information:
The text was updated successfully, but these errors were encountered: