You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first time this code runs, the snapshot value is an integer NSNumber. The second time, it's an NSDecimalNumber with a CFNumberType of kCFNumberDoubleType. Presumably this is because the persistent store is serializing numbers differently from the cloud Firebase. But Firebase queries should never yield doubles for round numbers like 42.
The text was updated successfully, but these errors were encountered:
collinjackson
changed the title
Persisted queries should return ints instead of round doubles after overwrites
Persisted queries should return ints instead of round doubles after int overwrites
Jun 20, 2017
I was able to reproduce your observations. It turns out that NSJSONSerialization returns floating point numbers if the value is a top-level value. While {foo:1} returns a long, {1} returns a double. We will get this fixed in the next release.
This was originally flutter/flutter#10825 but it looks like a Firebase bug.
Environment
Problem
Reduced test case:
The first time this code runs, the snapshot value is an integer NSNumber. The second time, it's an NSDecimalNumber with a CFNumberType of kCFNumberDoubleType. Presumably this is because the persistent store is serializing numbers differently from the cloud Firebase. But Firebase queries should never yield doubles for round numbers like 42.
The text was updated successfully, but these errors were encountered: