firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

Firestore Does not listening to acctualy data saved

Open yunesuk opened this issue 4 years ago • 2 comments

[REQUIRED] Describe your environment

  • Operating System version: windows 10
  • Browser version: react native 0.66.4
  • Firebase SDK version: 9.6.1
  • Firebase Product: firestore (auth, database, storage, etc)

[REQUIRED] Describe the problem

i have a friebase project in development mode i am creating a react native application , auth is working fine but firestore is not working as expected , when i use the same code in docs " inserting data to firestore...." it insert it and when i make a call to db with "getDoc" function it return the doc that i saved , the probleme is yesterday i was not able to connect to the firestore but today i can and it worked but the probleme now is the data not appearing in my firestore dashboard im very confused, i hope i will find the soltion of this probleme .

Relevant Code:

  // firebase.js  :
     import {initializeApp} from 'firebase/app';
import {getFirestore} from 'firebase/firestore';
import {getAuth} from 'firebase/auth';

const firebaseConfig = {
  //firebase config here
};
const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
export const db = getFirestore(app);
//====================

//getting the data from firestore 
 try {
      const citiesRef = collection(db, 'cities');
      const snap = await getDoc(doc(citiesRef, 'SF'));
      if (snap.exists()) {
        console.log('snap existe');
      } else {
        console.log('snap not existe');
      }
    } catch (error) {
      console.log(error.message);
    }

yunesuk avatar Dec 23 '21 16:12 yunesuk

Hi @YunsGeek, thanks for filing. Since it looks like this issue is related to the new one you've just provided with extra details. I'll be marking this one as a duplicate and close this for better tracking. We can continue investigating this on #5836. Thanks

argzdev avatar Dec 24 '21 10:12 argzdev

Duplicate of #5836

argzdev avatar Dec 24 '21 10:12 argzdev