Skip to content
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: hard crash using NSInternalInconsistencyException #4126

Merged
merged 1 commit into from
Aug 23, 2020

Conversation

mars-lan
Copy link
Contributor

@mars-lan mars-lan commented Aug 23, 2020

Description

https://firebase.google.com/docs/crashlytics/test-implementation?platform=ios recommends using "@[][1]" to crash, but that gets caught by react-native and shown as a red box for debug builds. Throw NSInternalInconsistencyException instead to generate a hard crash.

Related issues

#4026

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

Manually tested.


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@vercel
Copy link

vercel bot commented Aug 23, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/invertase/react-native-firebase/m7z0juo40
✅ Preview: https://react-native-firebase-git-fork-mars-lan-patch-4.invertase.vercel.app

@Salakar
Copy link
Member

Salakar commented Aug 23, 2020

This makes sense, the way we normally get around red box capturing expected exceptions is to throw inside a different thread on Android or on iOS a different GCD queue, but this works too I guess 🙃

Thanks for the PR 🎉

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the simple-as-dirt no threading solution, especially coupled with a nice developer note explaining the discrepancy, personally - this was in collaboration with me on the issue linked so I'm obviously for it. I take your comment as lukewarm acceptance @Salakar which seems good enough for me, so I'm going to go with it :-)

Thanks @mars-lan - your helping running this crashlytics stuff to ground has been fantastic. I still have on my personal list a quick investigation and change (if needed) to the default settings about data collection in release and debug to make sure platforms are consistent and well documented then hopefully it's a good experience out of the box for everyone again

@mikehardy mikehardy merged commit 2cbab5c into invertase:master Aug 23, 2020
@mikehardy
Copy link
Collaborator

Assuming CI passes (I worked hard on the E2E tests recently, I hope it just goes right through...) I'll hit the publish button unless there's an objection @Salakar :-)

@mikehardy
Copy link
Collaborator

Just went out as crashlytics 8.3.3, thanks again @mars-lan

@mikehardy
Copy link
Collaborator

Using SIGSEGV strategy from Sentry's test crash now merged in #4426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants