Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Avoid app crashing on access token change #744

Merged
merged 1 commit into from May 18, 2020

Conversation

syaau
Copy link
Contributor

@syaau syaau commented May 5, 2020

The access token change event is broadcasted from AccessTokenTracker
during app start, even before the react-native has fully initialized.
This results in a RuntimeException while trying to retrieve the
JSModule from context. This is just a safe escape hatch to avoid app
crashing. A more robust solution might be deferring the change event
after the react-native initializes.

Fixes #726

The access token change event is broadcasted from AccessTokenTracker
during app start, even before the react-native has fully initialized.
This results in a RuntimeException while trying to retrive the
JSModule from context. This is just a safe escape hatch to avoid app
crashing. A more robust solution might be deferring the change event
after the react-native initializes.
@syaau
Copy link
Contributor Author

syaau commented May 5, 2020

@chakrihacker Can you look into this ? Our app's top crash report on play store is resolved by this.

@chakrihacker
Copy link
Contributor

Hi @syaau how to reproduce the issue in order to test??

@syaau
Copy link
Contributor Author

syaau commented May 6, 2020

@chakrihacker I have tried a lot of different things, but I haven't been able to reproduce it yet. I had the app crash on my Android device once during app start and that was it. But when I look at the play store data, around 0.5% of the users have reported this crash. And this is on the top of the list.

@chakrihacker
Copy link
Contributor

OK, having try catch is always good 👋 , let the facebook devs take decision about it

@janicduplessis
Copy link
Contributor

I'm fine with that change, better than crashing!

@janicduplessis janicduplessis merged commit 9d6d0c0 into facebookarchive:master May 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

java.lang.RuntimeException com.facebook.AccessTokenTracker$CurrentAccessTokenBroadcastReceiver.onReceive
4 participants