Closed yzalvov closed 4 years ago
Thank you for reporting this issue, @yzalvov. The description and reproduction steps are fantastic and have allowed me to reproduce the issue just as you described. My first instinct is that our minification configuration changed, causing the _lat
and _long
fields here of the GeoPoint
class to get mangled. I'm starting to investigate this issue and will report back with my findings.
I do have one question though. Is this issue causing a bug in your application? Or is it just making debugging more challenging due to the mangled property names?
Hi Denver. I’m glad to help. Well, actually I got this issue today as a critical bug in my React Native
application after upgrading the Expo SDK
to v37, which upped firebase
to 7.9.0. One of my components failed to render markers on a map because of this issue.
I downed the firebase
to 7.8.2 and am fine at the moment.
Okay, thank you for confirming. Any properties whose names are prefixed with an underscore are not part of the public API and are subject to backwards-incompatible changes. In this case, _lat
and _long
are private implementation details of the class. The latitude and longitude of a GeoPoint
are meant to be accessed via the public latitude
and longitude
properties, respectively. Are you able to modify your code to use those two public properties instead?
https://firebase.google.com/docs/reference/js/firebase.firestore.GeoPoint#latitude
That’s the problem. I can see the latitude
and longitude
props in the browser environment, as API docs suggest. But they have never been returned to me inReact Native
. So I use what’s available.
I guess there’s something to be investigated on the Expo SDK
and React Native
side. Which is strange to me as no other discrepancies in firestore
returns were observed.
I agree that there may be something that needs to change in React Native Firebase or the Expo SDK. Using the private _lat
and _long
properties was never supported and now that they have been renamed it has seems to have broken things. Unfortunately, we will not be undoing this name mangling so the usages of those properties needs to be moved to the public latitude
and longitude
properties. I am not personally familiar with either of these SDKs so I'm afraid that I cannot be of much help. If you end up logging a ticket against one of the other SDKs, include the link here if you can. For now, I will close this issue since there is no action to be taken by the Firebase SDK team. Feel free to continue the discussion here though if you disagree.
Environment
Problem
Firestore no longer return
{ _lat, _long }
params for aGeoPoint
object inside a document. Firebase 7.8.2 was fine, but since 7.9.0 firestore returns different versions of those params names instead (depending on the firebase version you have). For 7.14.4 it goes as{ Ic: 55.760181, wc: 37.453117 }
for example.I guess it has something to do with a crippled look of
firebase.firestore()
service object whenconsole.log( firebase.firestore() )
it.Instead of its usual normal look in the console:
It goes crippled like:
Relevant Code:
– Fine behaviour with
firebase 7.8.2
(GitHub repo) – Problem with the same code butfirebase 7.14.4
(GitHub repo)* StackBlitz fails with
Error: firebase.firestore is not a function.
so GitHub repos instead.