Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPA multi-tenancy global search does not respect tenant switch #14196

Open
Plytas opened this issue Sep 10, 2024 · 2 comments
Open

SPA multi-tenancy global search does not respect tenant switch #14196

Plytas opened this issue Sep 10, 2024 · 2 comments
Labels

Comments

@Plytas
Copy link
Contributor

Plytas commented Sep 10, 2024

Package

filament/filament

Package Version

v3.2.110

Laravel Version

v11.22.0

Livewire Version

v3.5.6

PHP Version

PHP 8.3.7

Problem description

When using global search in SPA mode with multi-tenancy after switching to a different tenant, the results are displayed from a previous tenant. I believe that global search component is not reloaded and still uses initial tenant scope.

screenshot.84.mov

In this video I am on Team 1 tenant. I type post in global search and observe This post is on Team 1 record. After switching to tenant Team 2 I type post in global search and still observe This post is on Team 1 record.

Expected behavior

I expected search to work the same as it does in non SPA mode. Switching tenant and using global search should correctly scope the query to new tenant.

This is how it works in non SPA mode.

screenshot.85.mov

Steps to reproduce

  1. Clone the repo
  2. composer install
  3. php artisan migrate --seed
  4. Log in to the app on / route with the credentials: email - test@example.com, password - password
  5. Type post in the global search bar
  6. Observe that This post is on Team 1 is visible
  7. Switch the tenant to Team 2
  8. Type post in the global search bar
  9. Observe that This post is on Team 1 is still visible

Reproduction repository (issue will be closed if this is not valid)

https://github.com/Plytas/filament-spa-search

Relevant log output

No response

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
@Plytas Plytas added bug Something isn't working medium priority unconfirmed labels Sep 10, 2024
@renatofrota
Copy link

related discussion: #13742

@Plytas
Copy link
Contributor Author

Plytas commented Sep 20, 2024

Thanks @renatofrota! I could've sworn I looked through issues and discussions, but couldn't find anything related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants