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

bug(profile): providerData is written as empty array in Firestore #699

Closed
harshithmullapudi opened this issue May 12, 2019 · 5 comments
Closed
Assignees
Labels
Milestone

Comments

@harshithmullapudi
Copy link

harshithmullapudi commented May 12, 2019

It 's updating the profile in firestore with provider data as empty array and if we by default set profile how do we know that it's first login

Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?
react-redux-firebase : 3.0.0 - 11

@prescottprue
Copy link
Owner

You can provide profileFactory to change how profiles are written to Firestore (or Real Time Database if you are using that instead) as noted in the profile recipes section of the docs.

That said, provider data should only be included if it isn't an empty array, so I'll switch the ticket to focus on that.

@prescottprue prescottprue changed the title set profile updates with empty provider on firestore bug(profile): providerData is written as empty array in Firestore May 31, 2019
@prescottprue prescottprue mentioned this issue Jul 1, 2019
3 tasks
@prescottprue prescottprue added this to To do in v2.3.* via automation Jul 13, 2019
@prescottprue prescottprue added this to the v2.3.* milestone Jul 13, 2019
@prescottprue prescottprue self-assigned this Jul 13, 2019
@prescottprue prescottprue moved this from To do to Needs review in v2.3.* Jul 13, 2019
@prescottprue prescottprue moved this from Needs review to Reviewer approved in v2.3.* Jul 13, 2019
prescottprue added a commit that referenced this issue Jul 13, 2019
* feat(storage): pass file metadata through `uploadFile` to `storage.put` calls - #720
* fix(auth): pass `updateProfile` options to action - #701 - @cruzdanilo
* fix(profile): only include `providerData` if it is not an empty array in Firestore - #699
* feat(webpack): add `lodash-webpack-plugin` to shrink bundle size
@prescottprue
Copy link
Owner

Fix released in v2.3.0

v2.3.* automation moved this from Reviewer approved to Done Jul 13, 2019
@tomoyuki28jp
Copy link

@prescottprue I setup my react-redux-firebase like this.
https://react-redux-firebase.com/docs/recipes/roles.html#automatically-assign-role-when-user-signs-up

providerData is stored in firestore as a empty array even when user.providerData is not empty.

(Is this because firestore does not support directly nested arrays? firebase/firebase-js-sdk#193 (comment) )

@prescottprue
Copy link
Owner

@tomoyuki28jp Thanks for posting, the example should be updated - you may also want to stick to assigning roles in a cloud function since that makes it easier when it comes times to create security rules

@prescottprue prescottprue added this to In Progress in v3.0.0 Sep 5, 2019
prescottprue pushed a commit that referenced this issue Sep 6, 2019
…HOCs to prevent warnings with 16.9.0 - #755

fix(docs): update client side role assign example in roles recipes - #699
fix(docs): add example for assigning role in cloud function - #699
@prescottprue
Copy link
Owner

Updated the docs to also include an example of doing this with a cloud function

@prescottprue prescottprue mentioned this issue Sep 6, 2019
3 tasks
@prescottprue prescottprue moved this from In Progress to Under Review in v3.0.0 Sep 6, 2019
prescottprue added a commit that referenced this issue Sep 6, 2019
* feat(auth): remove `signIn` option from createUser (new user is automatically signed in through Firebase SDK) - #513
* feat(core): new pattern for getting extended firebase instance in thunks (added back `getFirebase` to api) - #635
* fix(HOCs): switch to `UNSAFE_componentWillReceiveProps` in class based HOCs to prevent warnings with 16.9.0 - #755
* fix(HOCs): switch `withFirebase` and `withFirestore` back to pre-hooks compatible logic
* fix(core): replace lodash methods such as `isArray`, `isBoolean`, `isString`, `size`, `compact` and `isFunction` with native methods in a number of places
* chore(deps): update lodash to 4.17.15
* chore(docs): add docs for how to reference data from state for reselect selectors - #614
* chore(docs): update client side role assign example in roles recipes - #699
* chore(docs): add example for assigning role in cloud function - #699
@prescottprue prescottprue moved this from Under Review to Done in v3.0.0 Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
v2.3.*
  
Done
v3.0.0
  
Done
Development

No branches or pull requests

3 participants