betaacid / expo-analytics

Google Analytics integration for use with React Native apps built on Expo
MIT License
286 stars 64 forks source link

Race condition: undefined is not an object (evaluating 'this.parameters[t]=n') #58

Closed giautm closed 4 years ago

giautm commented 4 years ago

I ran into this exception because promiseGetWebViewUserAgentAsync() take to long to complete and parameters stills undefined. (a.k.a: Race condition.)

It can fixed by init parameters with an empty object, then copy into current parameters alter promise resolved.

Screen Shot 2019-11-12 at 2 08 21 PM
ryanvanderpol commented 4 years ago

@murshudov quit spamming all the issues in here with your rip off copy of our work. You literally copied this library with no attribution.

BillyCottrell commented 4 years ago

In that case @murshudov you should have made a fork instead of a straight copy, plus you should have credited @ryanvanderpol as this is his project not yours. Even if there is not a single line of this repository that will be kept afterwards you still have to do this since this repository is the base for your personal project, especially because there is a MIT license on this project.

delanebob commented 4 years ago

@ryanvanderpol @giautm just wondering if there is any update when https://github.com/ryanvanderpol/expo-analytics/pull/59 will be getting merged in to fix this issue?

Seem to have the same issue myself when I try to call analytics.addParameter('ul', language); and it's throwing the same error.

ryanvanderpol commented 4 years ago

hey @delanebob, have you tried pulling in the branch from #59 and seeing if it resolves your issue? I'm not able to reproduce the problem myself, so that PR is really just waiting on objective confirmation that it fixes the issue (and does not cause additional side effects). If you believe #59 resolves the problem here, please drop a comment on it stating so and I'll get it merged and published.

delanebob commented 4 years ago

Hey @ryanvanderpol, I've just pulled in the branch from #59 now and there doesn't look like there is any side effects. It has also fixed the problem I was getting with the race condition.

I've attached a debug below and it seems like everything is normal.

Screenshot 2020-01-17 at 08 26 13

Is there anything else in particular you'd like me to double check?