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

🔥[v6] Firestore onSnapshot on a single document is always undefined #2449

Closed
1 of 5 tasks
FoodlyEric opened this issue Aug 6, 2019 · 2 comments
Closed
1 of 5 tasks
Assignees
Labels
plugin: firestore Firebase Cloud Firestore

Comments

@FoodlyEric
Copy link

Issue

When querying a single document using onSnapshot the document and exists property is undefined. Using get instead of onSnapshot works fine. Using onSnapshot on collection works fine too.

firestore().collection('Users').doc(userId).onSnapshot(snapshot=> {
  // these are both undefined
  console.log(snapshot.exists)
  console.log(snapshot.data())
})

--

  • Platform that you're experiencing the issue on:

    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:

    "@react-native-firebase/app": "^0.1.2",
    "@react-native-firebase/auth": "^0.1.2",
    "@react-native-firebase/firestore": "^0.1.2",
    "react": "16.8.6",
    "react-native": "0.60.4",

@FoodlyEric FoodlyEric changed the title [v6] 🔥Firestore onSnapshot on a single document is always undefined 🔥[v6] Firestore onSnapshot on a single document is always undefined Aug 6, 2019
@Salakar Salakar added Version: 6.x.x plugin: firestore Firebase Cloud Firestore labels Aug 6, 2019
@Ehesp Ehesp closed this as completed in f7eab31 Aug 7, 2019
@Ehesp
Copy link
Member

Ehesp commented Aug 7, 2019

Thanks for reporting! One line fixes this here. Will get sort a release out.

I'm more confused how the tests didn't pick this up to be honest so I'll be checking that out.

@Ehesp Ehesp mentioned this issue Aug 7, 2019
@Salakar
Copy link
Member

Salakar commented Aug 7, 2019

This has now been published in 0.1.3 of the new packages, see #2025 (comment).

Thanks

androidIsForVivek pushed a commit to androidIsForVivek/react-native-firebase that referenced this issue Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: firestore Firebase Cloud Firestore
Projects
None yet
Development

No branches or pull requests

3 participants