Skip to content

[HOLD for payment 2024-08-19] [HOLD for payment 2024-08-09] [$250] Associate crashes with specific logins #42651

Closed

Description

@roryabraham

Problem

When users report that their staging or production app crashed, it can be difficult to find the stacktrace for that crash after-the-fact. This makes it harder to identify and fix real-world crashes, leading to a poorer UX in terms of app quality and the level of support we can provide to users who do experience crashes.

Solution

Upon login, associate the user login with crashlytics user ID. That way, if the app crashes, the crash report will be logged along with the login for the user. Then we'll be able to search for crashes by user in the Crashlytics console, and maybe find out more.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019268795ed9fe7be1
  • Upwork Job ID: 1795144470205255680
  • Last Price Increase: 2024-05-27
  • Automatic offers:
    • getusha | Reviewer | 102519677
    • ShridharGoel | Contributor | 102519678
Issue OwnerCurrent Issue Owner: @dylanexpensify

Activity

  1. added
    External
    Daily
    Bug
    on May 27, 2024
  2. self-assigned this
    on May 27, 2024
  3. melvin-bot commented on May 27, 2024

    @melvin-bot
  4. changed the title [-]Associate crashes with specific logins[/-] [+][$250] Associate crashes with specific logins[/+] on May 27, 2024
  5. added
    Help Wanted
    on May 27, 2024
  6. melvin-bot commented on May 27, 2024

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External)

  7. melvin-bot commented on May 27, 2024

    @melvin-bot

    Triggered auto assignment to @dylanexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  8. roryabraham commented on May 27, 2024

    @roryabraham
    ContributorAuthor

    FWIW I think the code for this is the easy part - testing is the harder part. Not sure what's needed to test crashlytics locally

  9. dragnoir commented on May 27, 2024

    @dragnoir
    Contributor
  10. ShridharGoel commented on May 27, 2024

    @ShridharGoel
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    We need a way to associate crashes with IDs.

    What is the root cause of that problem?

    New feature.

    What changes do you think we should make in order to solve the problem?

    We can set the userId in crashlytics as soon as the login is done.

    Add the below in Expensify.tsx:

    useEffect(() => {
    if (isAuthenticated) {
        crashlytics().setUserId(Number(session?.accountID).toString()) // We can also use login by getting personal details via Onyx
    }
    }, [isAuthenticated, session?.accountID])
    

    Note:

    We can also add email info using crashlytics().setAttribute('userEmail', userEmail);.
    Also, details like device ID etc. can be added in the same way. If logged out, then instead of login we can pass something else like device ID in setUserId.

    For testing, we can use crashlytics().crash(); to mock it, and then an internal engineer can check the logs on Firebase.
    We'll also need to enable SEND_CRASH_REPORTS in debug mode.

    To test native crashes:

    Add a new option in TestToolMenu:

    <TestToolRow title="Test crash">
    <Button
        small
        text="Test crash"
        onPress={() => {
            crashlytics().crash();
        }}
    />
    </TestToolRow>
    

    To test JS crashes:

    Option 1:

    Just add <View>Test</View> anywhere, like in Expensify.tsx or ReportScreen.tsx.

    Option 2:

    Add a new item in TestToolMenu:

    <TestToolRow title="JS crash">
        <Button
            small
            text="JS crash"
            onPress={() => {
                Check
            }}
        />
    </TestToolRow>
    

    Since "Check" doesn't exist, this will lead to an exception.

    Update firebase.json to set crashlytics_debug_enabled to true.

    Note that local logs will show what data is being sent to Firebase, we can use that to verify the changes. Then, once it is on staging, then someone can check on Firebase (using the troubleshoot option).

    Native crash would not work on iOS debug build because we are on an old version. See invertase/react-native-firebase#6226

    We can also plan to bump the Firebase version in another task.

  11. 52 remaining items

  12. added
    Weekly
    and removed
    Weekly
    on Aug 8, 2024
  13. changed the title [-][HOLD for payment 2024-08-09] [$250] Associate crashes with specific logins[/-] [+][HOLD for payment 2024-08-19] [HOLD for payment 2024-08-09] [$250] Associate crashes with specific logins[/+] on Aug 12, 2024
  14. melvin-bot commented on Aug 12, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.18-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2024-08-19. 🎊

    For reference, here are some details about the assignees on this issue:

  15. melvin-bot commented on Aug 12, 2024

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@getusha] The PR that introduced the bug has been identified. Link to the PR:
    • [@getusha] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
    • [@getusha] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
    • [@getusha] Determine if we should create a regression test for this bug.
    • [@getusha] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@dylanexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  16. dylanexpensify commented on Aug 12, 2024

    @dylanexpensify
    Contributor

    Payment coming up!

  17. dylanexpensify commented on Aug 12, 2024

    @dylanexpensify
    Contributor

    Payment summary:

    Contributor: @ShridharGoe $250 via Upwork
    Contributor+: @getusha $250 via Upwork

    Please apply/request!

  18. dylanexpensify commented on Aug 21, 2024

    @dylanexpensify
    Contributor

    Confirming this is done

  19. JmillsExpensify commented on Aug 22, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @getusha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugExternalWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions