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

Associate crashes with user info #43063

Merged
merged 32 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
49691ca
Associate crashes with user info
ShridharGoel Jun 4, 2024
6a87f2b
Merge branch 'main' of https://github.com/Expensify/App into associat…
ShridharGoel Jun 6, 2024
e7c6950
Update
ShridharGoel Jun 7, 2024
4ff36f0
Update
ShridharGoel Jun 7, 2024
5a4322c
Update
ShridharGoel Jun 7, 2024
a07c2df
Update
ShridharGoel Jun 7, 2024
782dbd1
Merge branch 'main' of https://github.com/Expensify/App into associat…
ShridharGoel Jun 13, 2024
c0615dd
Update
ShridharGoel Jun 14, 2024
1038428
Update
ShridharGoel Jun 17, 2024
af7b29d
Update
ShridharGoel Jun 17, 2024
117be83
Update
ShridharGoel Jun 18, 2024
d9353aa
Update
ShridharGoel Jun 19, 2024
090c470
Update
ShridharGoel Jun 21, 2024
050b284
Merge branch 'main' of https://github.com/Expensify/App into associat…
ShridharGoel Jun 21, 2024
ca62e42
Show option only if config enabled
ShridharGoel Jun 24, 2024
b5090b9
Update
ShridharGoel Jul 4, 2024
1cb89e1
Update
ShridharGoel Jul 4, 2024
9eeee55
Update
ShridharGoel Jul 4, 2024
3e5f033
Update .eslintrc.js
ShridharGoel Jul 4, 2024
6833ee4
Update ContextMenuActions.tsx
ShridharGoel Jul 4, 2024
10cd8b5
Update ContextMenuActions.tsx
ShridharGoel Jul 4, 2024
2e6eba0
Update
ShridharGoel Jul 6, 2024
598c159
Merge branch 'associate-info' of https://github.com/ShridharGoel/Expe…
ShridharGoel Jul 6, 2024
eef37d5
Add text
ShridharGoel Jul 6, 2024
d0d3484
Update
ShridharGoel Jul 6, 2024
06e2616
Update
ShridharGoel Jul 6, 2024
fe9ce0f
Fixes
ShridharGoel Jul 6, 2024
3afbed8
Fixes
ShridharGoel Jul 7, 2024
4d26455
Update
ShridharGoel Jul 11, 2024
50ab2dd
Update
ShridharGoel Jul 12, 2024
e71d115
Update
ShridharGoel Jul 12, 2024
d4e3795
Delete src/libs/setCrashlyticsUserId/types.ts
ShridharGoel Jul 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Expensify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import * as ReportActionContextMenu from './pages/home/report/ContextMenu/ReportActionContextMenu';
import type {Route} from './ROUTES';
import type {ScreenShareRequest, Session} from './types/onyx';
import setCrashlyticsUserId from "@libs/setCrashlyticsUserId";

Check warning on line 40 in src/Expensify.tsx

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected subpath import via alias '@libs/setCrashlyticsUserId'. Use './libs/setCrashlyticsUserId' instead

Check failure on line 40 in src/Expensify.tsx

View workflow job for this annotation

GitHub Actions / Run ESLint

`@libs/setCrashlyticsUserId` import should occur before import of `./components/ConfirmModal`

Onyx.registerLogger(({level, message}) => {
if (level === 'alert') {
Expand Down Expand Up @@ -216,6 +217,10 @@
Audio.setAudioModeAsync({playsInSilentModeIOS: true});
}, []);

useEffect(() => {
setCrashlyticsUserId({isAuthenticated, accountID: session?.accountID})
}, [isAuthenticated, session?.accountID])

// Display a blank page until the onyx migration completes
if (!isOnyxMigrated) {
return null;
Expand Down
11 changes: 11 additions & 0 deletions src/components/TestToolMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import * as User from '@userActions/User';
import CONFIG from '@src/CONFIG';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Network as NetworkOnyx, User as UserOnyx} from '@src/types/onyx';
import testCrash from "@libs/testCrash";
import Button from './Button';
import {withNetwork} from './OnyxProvider';
import Switch from './Switch';
Expand Down Expand Up @@ -89,6 +90,16 @@ function TestToolMenu({user = USER_DEFAULT, network}: TestToolMenuProps) {
onPress={() => Session.invalidateCredentials()}
/>
</TestToolRow>

<TestToolRow title="Native crash">
<Button
small
text="Native crash"
onPress={() => {
testCrash();
}}
/>
</TestToolRow>
</>
);
}
Expand Down
11 changes: 11 additions & 0 deletions src/libs/setCrashlyticsUserId/index.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import crashlytics from '@react-native-firebase/crashlytics';
import type UseCrashlyticsProps from "./types";

const setCrashlyticsUserId = ({isAuthenticated, accountID}: UseCrashlyticsProps) => {
if (!isAuthenticated) {
return;
}
crashlytics().setUserId(Number(accountID).toString());
};

export default setCrashlyticsUserId;
4 changes: 4 additions & 0 deletions src/libs/setCrashlyticsUserId/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type UseCrashlyticsProps from "./types";

const setCrashlyticsUserId = (_: UseCrashlyticsProps) => {}

Check failure on line 3 in src/libs/setCrashlyticsUserId/index.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'_' is defined but never used
export default setCrashlyticsUserId;
6 changes: 6 additions & 0 deletions src/libs/setCrashlyticsUserId/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type UseCrashlyticsProps = {
isAuthenticated: boolean;
accountID: string | number | undefined;
};

export default UseCrashlyticsProps;
6 changes: 6 additions & 0 deletions src/libs/testCrash/index.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import crashlytics from "@react-native-firebase/crashlytics";

const testCrash = () => {
crashlytics().crash();
}
export default testCrash;
2 changes: 2 additions & 0 deletions src/libs/testCrash/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const testCrash = () => {}
export default testCrash;
Loading