Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jest.mock('utils/homeScreenAlerts', () => {
jest.mock('@react-native-async-storage/async-storage', () => ({
setItem: jest.fn(),
getItem: jest.fn(),
removeItem: jest.fn(),
clear: jest.fn(),
}))

Expand Down Expand Up @@ -109,6 +110,7 @@ context('DeveloperScreen', () => {
const latestAlertMockCall = mockAlertSpy.mock.calls.at(-1)[0]
latestAlertMockCall.buttons[1].onPress()

await waitFor(() => expect(AsyncStorage.removeItem).toHaveBeenCalledWith('@store_remote_config_overrides'))
await waitFor(() => expect(AsyncStorage.clear).toHaveBeenCalled())
Comment on lines +113 to 114
expect(mockDispatchSpy).toHaveBeenCalled()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
} from 'utils/homeScreenAlerts'
import { useAlert, useAppDispatch, useGiveFeedback, useRouteNavigation, useTheme } from 'utils/hooks'
import { STORAGE_REVIEW_EVENT_KEY, resetReviewActionCount } from 'utils/inAppReviews'
import { REMOTE_CONFIG_OVERRIDES_KEY } from 'utils/remoteConfig'

type DeveloperScreenSettingsScreenProps = StackScreenProps<HomeStackParamList, 'Developer'>

Expand Down Expand Up @@ -157,8 +158,9 @@ function DeveloperScreen({ navigation }: DeveloperScreenSettingsScreenProps) {
},
{
text: t('reset'),
onPress: () => {
AsyncStorage.clear()
onPress: async () => {
await AsyncStorage.removeItem(REMOTE_CONFIG_OVERRIDES_KEY)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't clear already remove the overrides? Are we seeing anyone trying to clear storage but keeping their overrides?

await AsyncStorage.clear()
dispatch(logout())
Comment on lines +162 to 164
},
},
Expand Down
Loading