-
Notifications
You must be signed in to change notification settings - Fork 935
Querying documents with DocumentReference
and GeoPoint
throws errors
#3006
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
Comments
I'm having the same issue |
Thanks for the bug report. Unfortunately, I cannot reproduce this issue locally. At first, I tried using Friendly Eats, which is in JavaScript. When that didn't work out, I downloaded the Stackblitz project you linked and ran it with {
posts: [
DocumentReference {
_key: [DocumentKey],
firestore: [Firestore],
_converter: undefined,
_firestoreClient: [FirestoreClient]
}
],
coordinates: GeoPoint { _lat: 0, _long: 0 }
} I cannot debug the issue on Stackblitz. Would it be possible for you to prepare a repro case that can be run locally? I have a suspicion that the error is caused by something in the setup/environment (if it were within the SDK itself, it would have probably been reproduced on FriendlyEats). Does this issue happen outside of Stackblitz? |
I don't think it's a ts-node/StackBlitz specific issue... 😕 I've included a suuuper simple repo and have it running on GH Pages, the issue seems to persist. |
Thank you! I can reproduce it now, will investigate further. |
This is a regression introduced in |
…dation (#3018) Fix the regression introduced in #2784: a `GeoPoint` where at least one of the coordinates is zero doesn't marshal properly. This is because zeroes happen to be serialized as `undefined` (presumably because protos normally treat zero values and the absence of a value interchangeably) which then fails the strict input validation in `GeoPoint`. Fixes #3006.
Uh oh!
There was an error while loading. Please reload this page.
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Steps to reproduce:
Add a document to Firestore (
doc1
) with a GeoPoint set to0, 0
, take a reference to the added document (doc1
) and add it as field in an array to a new document (doc2
) as well as a GeoPoint set to0, 0
. Query for the second document (doc2
) and try to get thedata()
of it. It will throw an error saying:FirebaseError: [code=invalid-argument]: Function GeoPoint() requires its first argument to be of type number, but it was: undefined
.However if you change the coordinates to
1, 1
there is no issue what so ever!Relevant Code:
https://stackblitz.com/edit/firebase-js-sdk-3006?file=index.ts
Update, if any field of the
GeoPoint
is0
this issue occurs.The text was updated successfully, but these errors were encountered: