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

useRxData collection filtering briefly malfunctions #85

Open
nukeop opened this issue Apr 5, 2024 · 0 comments
Open

useRxData collection filtering briefly malfunctions #85

nukeop opened this issue Apr 5, 2024 · 0 comments

Comments

@nukeop
Copy link

nukeop commented Apr 5, 2024

I'm trying to load data belonging to some user like this:

useRxData<Stuff>(
        'stuff',
        (collection) => collection.find().where('user_id').equals(user?.id),
);

This works, but there's a brief moment where it loads everything regardless of user_id. I can't fix it by using row level security, because those other rows are intended to be public, just displayed elsewhere. They flash for a moment, then disappear again. If I console.log the retrieved dcouments, you can see the hook first returns 0 (before fetching), then 11 (with isFetching set to false), then 11 with isFetching set to true, then 2, then 11, then 2 again. 2 is the number of elements after filtering.

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant