Skip to content

Commit

Permalink
chore: add statsig stable id to debug screen (#5343)
Browse files Browse the repository at this point in the history
### Description

as the title, useful for overriding stable id based gates / experiments

### Test plan

Manually checked debug screen

### Related issues

N/A

### Backwards compatibility

N/A

### Network scalability

N/A
  • Loading branch information
satish-ravi committed Apr 26, 2024
1 parent 05b9ef2 commit 896df3c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/Debug.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { Provider } from 'react-redux'
import Debug from 'src/app/Debug'
import { createMockStore } from 'test/utils'

jest.mock('statsig-react-native', () => ({
Statsig: {
getStableID: () => 'stableId',
},
}))

describe('Debug', () => {
it('renders correctly', () => {
const tree = render(
Expand Down
5 changes: 5 additions & 0 deletions src/app/Debug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { RootState } from 'src/redux/reducers'
import Logger from 'src/utils/Logger'
import { currentAccountSelector } from 'src/web3/selectors'
import { getLatestBlock } from 'src/web3/utils'
import { Statsig } from 'statsig-react-native'

interface State {
latestBlockNumber: number
Expand Down Expand Up @@ -55,6 +56,7 @@ export class Debug extends React.Component<RootState, State> {
const buildNumber = DeviceInfo.getBuildNumber()
const apiLevel = DeviceInfo.getApiLevelSync()
const deviceId = DeviceInfo.getDeviceId()
const stableId = Statsig.getStableID()

return (
<SafeAreaView style={styles.container}>
Expand All @@ -71,6 +73,9 @@ export class Debug extends React.Component<RootState, State> {
onPress={this.onClickText(address)}
style={styles.singleLine}
>{`Address: ${address}`}</Text>
<Text onPress={this.onClickText(stableId)} style={styles.singleLine}>
{`Statsig Stable ID: ${stableId}`}
</Text>
<Text style={styles.singleLine}>{`Latest Block: ${latestBlockNumber}`}</Text>
<Button
onPress={this.onClickEmailLogs}
Expand Down
11 changes: 11 additions & 0 deletions src/app/__snapshots__/Debug.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ exports[`Debug renders correctly 1`] = `
>
Address: 0x0000000000000000000000000000000000007e57
</Text>
<Text
onPress={[Function]}
style={
{
"fontSize": 11,
"marginTop": 5,
}
}
>
Statsig Stable ID: stableId
</Text>
<Text
style={
{
Expand Down

0 comments on commit 896df3c

Please sign in to comment.