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

feat(crashlytics)!: upgrade to new Firebase Crashlytics SDK #3580

Merged
merged 7 commits into from
Jun 30, 2020

Conversation

Aure77
Copy link
Contributor

@Aure77 Aure77 commented Apr 29, 2020

Description

Fabric is deprecated and will be available until May 4, 2020.
Fabric is now part of Firebase services.
Firebase has introduced a new SDK for handling Crashlytics reports. So this PR is an upgrade from upcoming deprecated Fabric SDK to new Firebase Crashlytics SDK.

Release Summary

Upgrade to new Firebase Crashlytics SDK

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

image

@CLAassistant
Copy link

CLAassistant commented Apr 29, 2020

CLA assistant check
All committers have signed the CLA.

@Aure77 Aure77 force-pushed the feature/new-firebase-crashlytics-sdk branch 2 times, most recently from bda9a8c to e96daba Compare April 29, 2020 23:21
@mikehardy
Copy link
Collaborator

First I just want to say this is fantastic. Thank you for taking this on

But second I do want to say that using the SDK, but connected to Firebase vs legacy Fabric is (I believe) not what's going away on May 4, 2020. I refer to these as Fabric/Fabric Crashlytics, Fabric/Firebase Crashlytics and Firebase/Firebase Crashlytics. I could be wrong but the Firebase/Firebase Crashlytics beta literally just came out of beta and I can't imagine them then having a whole vital service going away about 6 days later. I think Fabric/Fabric Crashlytics is going away, but Fabric/Firebase Crashlytics is fine if I understand it correctly.

All of that said, forward-porting to the future - which is Firebase/Firebase Crashlytics of course is important so this effort is huge. I just don't think it's on a such a high pressure deadline

@Aure77 Aure77 force-pushed the feature/new-firebase-crashlytics-sdk branch 3 times, most recently from 4821504 to 78f42bf Compare May 4, 2020 15:10
@mikehardy mikehardy requested review from Ehesp and Salakar and removed request for Ehesp May 4, 2020 15:10
public void setUserEmail(String userEmail, Promise promise) {
if (ReactNativeFirebaseCrashlyticsInitProvider.isCrashlyticsCollectionEnabled()) {
Crashlytics.getInstance().core.setUserEmail(userEmail);
FirebaseCrashlytics.getInstance().setUserId(userId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to the init changes, are setUserName and setUserEmail going away?
If functionality is being reduced or changed there should be some migration documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=ios#setuseridentifier_is_now_setuserid_setusername_and_setuseremail_are_removed

Reason for change
We adopted the method name setUserID to be consistent with other Firebase APIs and removed setUserName and setUserEmail to discourage logging PII through Crashlytics.

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 think there should be some migration information as commented in my specific review notes, to help developers understand how to enable this in debug builds now, and the migration to setUserId vs setUserName/setUserEmail, but I want to be clear that I consider those important but small things vs most of this looking right on to me?

@Salakar / @Ehesp - do either of you two have time for a review of this? It's an important forward-port step for react-native-firebsea

// TODO(salakar): 6.x/7.x Option to disable auto init
// TODO(salakar): If disabled; when the default app is initialized from JS land then init crashlytics (register a block handler somehow in RNFBApp?)
if ([[RNFBJSON shared] contains:KEY_CRASHLYTICS_DEBUG_ENABLED]) {
[Crashlytics sharedInstance].debugMode = [[RNFBJSON shared] getBooleanValue:KEY_CRASHLYTICS_DEBUG_ENABLED defaultValue:NO];
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like the way to turn it on in debug now is -FIRDebugEnabled in iOS, in Android unsure? https://firebase.google.com/docs/crashlytics/test-implementation-new-sdk?platform=ios#enable_debug_logging

@Aure77
Copy link
Contributor Author

Aure77 commented May 4, 2020

I having issue with e2e testing. More specifically with FirebaseInstanceId delete functions. Could you give me some support ? I saw that there is SDK change on instanceId in 6.15.0.
And there is maybe API-restrictions:
https://firebase.google.com/support/release-notes/ios#instanceid_5

Added a new dependency on the Firebase Installations SDK. The Firebase Installations SDK introduces the Firebase Installations API. Developers that use API-restrictions for their API-Keys may experience blocked requests (https://stackoverflow.com/questions/58495985/). A solution is available here. (#4533)

@Salakar Salakar self-assigned this May 12, 2020
@Salakar
Copy link
Member

Salakar commented May 12, 2020

Quick glance this provisionally looks ok to me, though I need to do a proper full review still which I'll do on Friday.

I think there's a couple external blockers here still that I need time to sort;

  • InstanceID / Installations change
    • Currently blocking upgrading Android & iOS Firebase SDK versions. I need to look into what this change actually means and setting up a new installations package to support it. This is whats causing the E2E failure on this PR.
  • Firebase SDK version change support on master needs a release still
    • It's ready to release automatically on master, but there's a bit of meta work around it that needs doing first - e.g. a changelog/post explaining the major version change across the board and new independent versioning setup, which I've not had time to do yet

@Aure77
Copy link
Contributor Author

Aure77 commented May 13, 2020

I have try InstanceID on e2e. I don't know what the problem. But my first observation is that some methods (delete) never ends, so promise never get resolved (and test fail).
I think this maybe a quota limit issue (chain get/delete id) ?

@Salakar
Copy link
Member

Salakar commented May 23, 2020

Master now has the updated Firebase SDK, so this PR is now unblocked, would you be able to sync with master and resolve any conflicts? Thanks

@Aure77
Copy link
Contributor Author

Aure77 commented Jun 30, 2020

@mikehardy PR is up to date & fix FirebaseCrashlyticsCollectionEnabled is done.
There is Spelling & Grammar that fail on a file that is not part of this PR. Is it normal ?

@Aure77 Aure77 force-pushed the feature/new-firebase-crashlytics-sdk branch from 79e6e68 to cc4f018 Compare June 30, 2020 08:53
@Aure77 Aure77 force-pushed the feature/new-firebase-crashlytics-sdk branch from cc4f018 to 65c9edd Compare June 30, 2020 09:57
@TPXP
Copy link
Contributor

TPXP commented Jun 30, 2020

Thanks for taking my feedback into account, for what it's worth we have a production build with those changes and it works perfectly, so I believe this is good to go :-)

@mikehardy
Copy link
Collaborator

@Aure77 champion! 🏆 thank you! Good question about the spell check. @Salakar / @andersonaddo the spelling failure is from faqs-and-tips so should have been flagged there #3524 - this PR should be green or at least not blocked by that CI failure.

@TPXP fantastic that you took the initiative to integrate the PR locally and report success, that helps a lot

I don't think there should be anything in the way of this? Hopefully it can go in quickly before some new conflict creeps into it 🙏

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.

Thank you very much!

@andersonaddo
Copy link
Contributor

IIRC, it wasn't because of a spelling mistake; I think it was because I used an acronym ("RNFB"). I figured it'd be fine.

Should I push a fix?

@Salakar
Copy link
Member

Salakar commented Jun 30, 2020

Should I push a fix?

Nah, fix it in post. About to merge and release, can send a grammar PR after if you like :)

@mikehardy
Copy link
Collaborator

@andersonaddo it is actually the string 'qa' 🤷 - seems valid in a software context

@Salakar Salakar changed the title feat(crashlytics): Upgrade to new Firebase Crashlytics SDK feat(crashlytics)!: upgrade to new Firebase Crashlytics SDK Jun 30, 2020
@Salakar Salakar merged commit cad58e1 into invertase:master Jun 30, 2020
@Salakar
Copy link
Member

Salakar commented Jun 30, 2020

LGTM! Shipped! A new major release will be up shortly after CI finishes. Thanks everyone that contributed.

LGTM GIF

@Aure77 Aure77 deleted the feature/new-firebase-crashlytics-sdk branch June 30, 2020 20:37
@mikehardy
Copy link
Collaborator

I just integrated this in my work project with no issue, and my test crash button worked as expected in android and ios, perfect

andersondanilo pushed a commit to vixtech/react-native-firebase that referenced this pull request Nov 9, 2020
…e#3580)

Goodbye Fabric, hello Firebase Crashlytics.

BREAKING CHANGE: This is a breaking change to remove the use of the Fabric SDKs.

Co-authored-by: David Buchan-Swanson <david.buchanswanson@gmail.com>
Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>
[publish]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: crashlytics Firebase Crashlytics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants