-
Notifications
You must be signed in to change notification settings - Fork 27
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
Loading state does not work with syncing empty collection #238
Comments
Not sure I understand the problem. Do you mean that |
I am, but if the returned result of a sync collection is an empty array then loading never goes from TRUE to FALSE. It is set up to only turn the loading state FALSE in |
Can you create a PR with a unit test reproducing the issue? |
Sure, will see what I can throw together this week. 👍 |
Any news here? |
@Benny739 feel free to make a PR. Nobody seems to be working on this one. |
@Benny739 @hakimio Wanted to get this done the 9 to 5 is more like 9 to 9 these days. I'm happy to help, but won't get back to this for another week or so when I hop back on the project I was doing this for. I never really used the loading states in this until I had a brand new project to do so and noticed them broken. I almost 100% I have a valid fix by must moving the setLoadingState higher up in the call action. |
Do you have an idea how to solve this? CollectionChanges doesn't emit anything when there is no data. We switched to CollectionData in our app and then we replace all data in the store every time we get new data, but this is not very beautiful. There is already an open bug in rxfire: FirebaseExtended/rxfire#55 |
Yes, my original post shows where a change could be made. I have been a bit underwater as of late, but should be able to work on this next week. The RxFire bug is interesting as I did not encounter than in this, but In my tests I don't know that I'm syncing with a query. I will say if the RxFire bug is legit, solving this problem here will only solve it for syncing w/o a query. RxFire would still have to be fixed for a full solution. |
If I'm syncing a collection and it is empty the loading state will not revert to false.
The loading state does not turn false till we process individual documents. HERE
It would seem to me that we could reset the store HERE instead of where the results of the sync'd collection is returned.
Thoughts, or am I very wrong here?
The text was updated successfully, but these errors were encountered: