-
Notifications
You must be signed in to change notification settings - Fork 136
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
Fix SDK to not use reject in SDK methods to not cause crashes #386
Conversation
There is some inconsistency between our 2 native SDKs though.
} | ||
promise.resolve(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Analytics.trackEvent(event)
API returns a promise actually. This will change this API to return a resolved promise containing null
instead of a rejected promise containing the error. It's not quite ideal to get a resolved promise containing null
. We should think more about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After thinking more about it, since Analytics.trackEvent(event)
API is supposed to be a void method on native SDKs, it's actually the right thing to return a resolved promise wrapping null
as result. And native SDKs already logs the error and we don't need to log the same error in JS, so resolving the promise in native bridge code is the right thing to do.
My conclusion is this PR is the right change.
No description provided.