-
Notifications
You must be signed in to change notification settings - Fork 30
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
[USERS SUB-PR] Changes profile loading logic #1081
Conversation
Just got an enlightening that it won't work for new users since they have a different flow(where the profile is probably getting fetched before the users) |
This relates to the bug in prescottprue/react-redux-firebase#914 In prescottprue/react-redux-firebase#914 (comment)
The reason we get the 1 by 1 updates is the
Which means we are mostly just dealing with the
In prescottprue/react-redux-firebase#914 (comment):
If that comment is true, then it sounds like it would be possible to make a minimal test case to 'reproduce' this bug, where you have 2 @mike-lvov This would be the area I would probably focus on looking at at first, since that would probably prove/disprove that that would be the issue https://firebase.google.com/docs/firestore/query-data/listen#view_changes_between_snapshots
If we can't figure out how to fix it in the library, we could quite probably just set up our own By looking at where the These are the places I would start looking if I were trying to solve this bug in the library itself. |
@mike-lvov can you please add a comment explaining why you're closing PR's when you do, so that we have some context captured. |
@0xdevalias This PR became unrelated since in this PR I try to find a workaround for |
Thanks for that :) The context just helps if we come back to it in future and wonder why it was closed. This way we have a simple summary to sum it all up and don't need to look deeper. |
#1047 working on this PR, I have discovered that when there was even a lightest delay for users fetching, it produced "one-by-one addition to the store" bug.
While I was trying to figure out why that was happening (I thought I solved that by having one query of users), I spent a few hours debugging that. My finding was that the
profile
store was actually adding the first item to theusers
store. It means that if we load the profile first, it will update theusers
store to thisworldUsers: [{.MY_PROFILE_OBJECT }]
. Because of this lib's optimization, I had to find a workaround for this.This PR is a draft proposal. I don't see any other way to handle this so far, I'm opened to any suggestions since I spent the whole day trying to figure out the way to handle this.