Closed k0ff33 closed 5 years ago
I've also experienced this issue, too. And I decided to remove geo location info when user dose not provide it, rather than setting GeoPoint(0, 0). Because it is more natural.
Anyhow IMHO this issue is bug. There shouldn't have exception for GeoPoint(0,0).
@k0ff33 Can you try this with the latest version of firebase-functions
?
@thechenky Tested this with the latest version of firebase-functions (v2.1.0). The API has been changed since the version used in the question, from onWrite((event)=>{}) to onWrite((change, context)=>{}). However, I was able to parse GeoPoint(0,0) using change.after.data().
@joehan thanks for the update! @k0ff33 please update to the latest version of firebase-functions
as this has been fixed.
Closing this out.
Version info
firebase-functions: 0.8.1
firebase-tools: 3.17.4
firebase-admin: 5.8.2
Steps to reproduce
new firebase.firestore.GeoPoint(0, 0)
(web SDK)event.data.data()
Were you able to successfully deploy your functions?
No errors, successfully deployed.
Expected behavior
Function should parse the data to a valid GeoPoint object with _latitude of 0 and longitude of 0. Similar situation with
new firebase.firestore.GeoPoint(1, 1)
works perfectly fine.Actual behavior
Not working example with GeoPoint(0, ):
Working example with GeoPoint(1, 1):