StasDoskalenko/react-native-google-fit

GoogleFit.getXXXSamples(options) returns with no data

edvardmk opened this issue · 1 comments

Hi, as some people reported in earlier issues, there are specific circumstances in which some of the get_XXX_Samples(options) methods return without data. I tested different setups and could narrow down the error to the following in my case:

The method fails silently returning an empty array after a runtime for about 1 minute, if the interval between startDate and endDate of the options object is bigger than ~7,3 years.

In case endDate is not provided, it will be set to now, e.g. new Date() and the same problems occurred. These are the max intervals I could determine for some of the functions:
getActivitySamples 2637 days
getBloodPressureSamples 2672 days
getDailyNutritionSamples 2678 days
getDailyStepCountSamples fails/works inconsistently, but roughly around 2637 days
getWeightSamples 2686 days

getBloodGlucoseSamples and getHeightSamples don't seem to have an issue with huge intervals and I didn't test the other methods.

I hope this helps hunt down the bug and in the meantime helps others working around this issue. Also thanks for the great work so far on this library!

#207 (comment) does this help?