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

Controller loading State #1216

Closed
korgon opened this issue Dec 3, 2024 · 1 comment · Fixed by #1224
Closed

Controller loading State #1216

korgon opened this issue Dec 3, 2024 · 1 comment · Fixed by #1224
Labels
type: bug Something isn't working

Comments

@korgon
Copy link
Contributor

korgon commented Dec 3, 2024

There exists a condition whereby the controllers can get locked into a loading: true state. This state is set when the beforeSearch event kicks off, and typically is set to false when the afterStore event concludes. In the SearchController, the loading state never returns to false when the following return takes place:
https://github.com/searchspring/snap/blob/v0.61.5/packages/snap-controller/src/Search/SearchController.ts#L355

However, I am pretty sure that this return would also leave the controller in a similar state:
https://github.com/searchspring/snap/blob/v0.61.5/packages/snap-controller/src/Search/SearchController.ts#L344

There is a "catch" block below that does set the loading state back to false when errors are caught, but that does not happen in the cases above.
https://github.com/searchspring/snap/blob/v0.61.5/packages/snap-controller/src/Search/SearchController.ts#L530

The other controller types likely have similar issues. We should ensure that when a search cancels, errors out, or is prevented that the loading state is properly set back to false. Testing should be improved around these situations to validate that we have the proper state (loading: false).

@korgon korgon added the type: bug Something isn't working label Dec 3, 2024
@korgon
Copy link
Contributor Author

korgon commented Dec 10, 2024

Released in 0.62.0!

@korgon korgon closed this as completed Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant