You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-08-19] [HOLD for payment 2024-08-09] [$250] Associate crashes with specific logins #42651
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2
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.
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.
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).
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
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:
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:
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2
Activity
melvin-bot commentedon May 27, 2024
Job added to Upwork: https://www.upwork.com/jobs/~019268795ed9fe7be1
[-]Associate crashes with specific logins[/-][+][$250] Associate crashes with specific logins[/+]melvin-bot commentedon May 27, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (
External)melvin-bot commentedon May 27, 2024
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.roryabraham commentedon May 27, 2024
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
dragnoir commentedon May 27, 2024
I can see some ideas here for crashing the app https://stackoverflow.com/questions/11807354/how-to-crash-an-android-app-programmatically
ShridharGoel commentedon May 27, 2024
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:
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_REPORTSin debug mode.To test native crashes:
Add a new option in TestToolMenu:
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:
Since "Check" doesn't exist, this will lead to an exception.
Update firebase.json to set
crashlytics_debug_enabledto 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.
52 remaining items
[-][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[/+]melvin-bot commentedon Aug 12, 2024
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:
melvin-bot commentedon Aug 12, 2024
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:
dylanexpensify commentedon Aug 12, 2024
Payment coming up!
dylanexpensify commentedon Aug 12, 2024
Payment summary:
Contributor: @ShridharGoe $250 via Upwork
Contributor+: @getusha $250 via Upwork
Please apply/request!
dylanexpensify commentedon Aug 21, 2024
Confirming this is done
JmillsExpensify commentedon Aug 22, 2024
$250 approved for @getusha