Clear feature flag override async storage during reset async storage#13409
Clear feature flag override async storage during reset async storage#13409Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/department-of-veterans-affairs/va-mobile-app/sessions/5d11d2f4-1930-4498-9671-39efd95fc160 Co-authored-by: dumathane <46909588+dumathane@users.noreply.github.com>
Agent-Logs-Url: https://github.com/department-of-veterans-affairs/va-mobile-app/sessions/5d11d2f4-1930-4498-9671-39efd95fc160 Co-authored-by: dumathane <46909588+dumathane@users.noreply.github.com>
|
@Copilot Please link this pull request to an issue (you may need to rerun the failed workflow). Alternatively, you can add the no-issue label to skip this requirement. |
|
Kicking a testflight build to test. |
There was a problem hiding this comment.
Pull request overview
Updates the Developer Screen “Reset async storage” flow to explicitly remove the Remote Config feature-flag overrides key before clearing AsyncStorage, and adds unit test coverage for that behavior to ensure the override key does not persist across a reset.
Changes:
- Remove
REMOTE_CONFIG_OVERRIDES_KEY(@store_remote_config_overrides) explicitly during the “Reset async storage” confirm action. - Await
AsyncStorage.clear()before dispatchinglogout()to make the reset sequence deterministic. - Update
DeveloperScreenunit test to assert the override key removal call occurs when reset is confirmed.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
VAMobile/src/screens/HomeScreen/ProfileScreen/SettingsScreen/DeveloperScreen/DeveloperScreen.tsx |
Adds explicit removal of the Remote Config overrides key and awaits storage clear before logout. |
VAMobile/src/screens/HomeScreen/ProfileScreen/SettingsScreen/DeveloperScreen/DeveloperScreen.test.tsx |
Extends AsyncStorage mock and asserts the override key removal call during reset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| await AsyncStorage.removeItem(REMOTE_CONFIG_OVERRIDES_KEY) | ||
| await AsyncStorage.clear() | ||
| dispatch(logout()) |
| await waitFor(() => expect(AsyncStorage.removeItem).toHaveBeenCalledWith('@store_remote_config_overrides')) | ||
| await waitFor(() => expect(AsyncStorage.clear).toHaveBeenCalled()) |
| onPress: () => { | ||
| AsyncStorage.clear() | ||
| onPress: async () => { | ||
| await AsyncStorage.removeItem(REMOTE_CONFIG_OVERRIDES_KEY) |
There was a problem hiding this comment.
Doesn't clear already remove the overrides? Are we seeing anyone trying to clear storage but keeping their overrides?
Description of Change
@store_remote_config_overrides) before clearing AsyncStorage and logging out.AsyncStorage.clear()before logout to keep reset sequencing deterministic.Target Release Date
N/A
Link to Issue
No issue linked
Code testing
Pre-QA Artifacts
Include all artifacts or select not applicable and explain below.
This PR changes developer reset behavior and unit tests only; no end-user UI change requiring visual artifacts.
Test Context for QA
How does a user get here?
Feature Flags
Risk Assessment:
What should QA pay extra attention to?
Test Review
DeveloperScreen.test.tsxreset async storage test to assertAsyncStorage.removeItem('@store_remote_config_overrides')is called.Test User(s)
Checklist for QA
QA Engineer: Check off the items below as you test