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

find() with paginateOn: 'server' has query ignored if no results returned #126

Open
MajesticPotatoe opened this issue May 4, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@MajesticPotatoe
Copy link
Contributor

When using useFind() with { paginateOn: 'server' } and a query is performed via find() (destructured or service().find()) that returns empty results, data doesn't update. When this occurs, the find() query is ignored and will revert to displaying whatever the previous query results (essentially ignoring the query all together). This can be observed via pinia devtools. (queriedAt for the most recent pagination doesn't even update).

This also can be seen indirectly with { paginateOn: 'hybrid' } as well.

@krislintigo
Copy link

krislintigo commented Jun 21, 2023

Yeah, noticed that too. I think the problem is here, when query is not tracked when total is 0 (found this in source code)
image

@marshallswain marshallswain added the bug Something isn't working label Jul 25, 2023
@marshallswain
Copy link
Owner

Thanks @MajesticPotatoe and @1sses. This looks like a legitimate bug. It will be a while before I can do anything to fix it, so this issue will remain open until I or someone else can come up with a solution.

@MajesticPotatoe
Copy link
Contributor Author

no worries, pretty much my work around for the time being is to just clear store before query (not ideal but luckily it doesn't effect much for my use case)

@marshallswain
Copy link
Owner

I'm going to update that conditional to see if it fixes our problem. It's a quick and dirty fix, since I didn't specifically update tests for it. I've just fixed the conditional in feathers-pinia@3.0.6. Please try it out to see if it fixes the issue you're facing. Thanks again for reporting!

@marshallswain
Copy link
Owner

I'm reverting the change. Integrating into a published app fails. I'll work on this another time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants