React-native-firebase: Unknown data type received timestamp

Created on 19 Apr 2019  路  12Comments  路  Source: invertase/react-native-firebase

after update react-native-firebase 5.3.1

This warning has begun. "Unknown data type received timestamp"

Recognize timestamp type as a warning

example

  1. set data
    firebase.firestore().collection('Test').doc('Test1')
    .set({
    createAt:firebase.firestore.FieldValue.serverTimestamp()
    })

no problem!

after that

  1. get data
    firebase.firestore().collection('Test').doc('Test1')
    .get()
    .then(snapshot =>{
    //warning!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    //Unknown data type received timestamp
    });

"react-native-firebase": "^5.3.1"
"react-native": "^0.59.5"

Needs Repro Firestore

Most helpful comment

Getting this error as well, any updates? I get "Unknown data type received function" infinitely, until I reload the app.

All 12 comments

Did you update all the deps in gradle as well? The firestore change was to track upstream as they changed, you'll need the 18.x version

https://github.com/invertase/react-native-firebase-starter/commit/926a4f89b9087096c901670896c55407d626a60d#diff-dc46f9f5dfe204e394fb41395ccd03cfR189

Yes this is my build.gradle

// RNFirebase required dependencies
implementation "com.google.firebase:firebase-core:16.0.8"
implementation "com.google.android.gms:play-services-base:16.1.0"
// RNFirebase optional dependencies
implementation "com.google.firebase:firebase-analytics:16.4.0"
implementation "com.google.firebase:firebase-ads:15.0.1"
implementation "com.google.firebase:firebase-auth:16.2.1"
implementation "com.google.firebase:firebase-config:16.5.0"
implementation "com.google.firebase:firebase-database:16.1.0"
implementation "com.google.firebase:firebase-firestore:18.2.0"
implementation "com.google.firebase:firebase-messaging:17.5.0"
implementation "com.google.firebase:firebase-perf:16.2.5"
implementation "com.google.firebase:firebase-storage:16.1.0"
implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
transitive = true
}

Huh. Versions look good (at least for firestore, I just focused on that) - @Salakar - this work is fresh and the timestamp is exactly in the area that was changed. Might be something here...

Hmm may be an issue with the bridge serialisation logic, will take a look tomorrow and report back.

Thanks for all the help you've been giving with issue triaging btw @mikehardy - really appreciate it

@Salakar
The folder you mentioned does not exist
Is the path right?

image

Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.

Getting this error as well, any updates? I get "Unknown data type received function" infinitely, until I reload the app.

As near as we can tell, if you are on react-native-firebase 5.x.x current (5.4.2 now I believe), and you are on current firestore (com.google.firebase:firebase-firestore:19.0.0 for me on android, pod 'Firebase/Firestore', '~> 5.20.2' on iOS) this should work. It was a specific change in firestore, and a specific change in react-native-firebase to handle it, so the versions are vital.

To make sure your project doesn't have some bizarre state, I recommend npm i react-native-clean-project && react-native clean-project-auto && cd ios && pod install - it will take a while but you should be pretty clean after that in case there is some old bundle or something. Even then you might react-native start -- --reset-cache and do a specific search for bundles in your assets files (I know I have to pre-build a bundle for old APIs like API17 at least since it can't do reverse port forwarding to load it from the dev server, and sometimes forget it's there)

I'm shaping up the next release and this was tagged for it but we can't reproduce this and haven't heard back. I'm going to close this but of course we can discuss again or reopen as needed.

@mikehardy @Salakar

I'm getting this error as well. react-native: 0.60.6 react-native-firebase: 5.5.6. I'm calling the same function with the same data and it works from one component, get the error (infinite warnings) from another component.

image

After the last line executes I get these infinite warnings and I have to restart the app

image

PS - I tried clearing cache, deleting + installing packages, pods, etc etc. with no success to see if I was in a "weird state"

Nevermind, I figured it out! I have an object with lots of data that at some point in my application in one of my components I add a React property to (to reference markers on a map). This Ref had "symbols" and "functions" inside it's properties (i.e. __proto__, etc). So I actually did have bad data updating to firestore.

Was this page helpful?
0 / 5 - 0 ratings