Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Clear feature flag override async storage during reset async storage#13409

Open
Copilot wants to merge 2 commits into
developfrom
copilot/remove-asyncstorage-feature-flags
Open

Clear feature flag override async storage during reset async storage#13409
Copilot wants to merge 2 commits into
developfrom
copilot/remove-asyncstorage-feature-flags

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

Description of Change

  • Updated Developer Screen "Reset async storage" flow to explicitly remove the feature-flag override key (@store_remote_config_overrides) before clearing AsyncStorage and logging out.
  • Added/updated unit test coverage to verify the override key removal is called when reset is confirmed.
  • Also awaited AsyncStorage.clear() before logout to keep reset sequencing deterministic.
  • Copilot review comment about redundancy was reviewed; explicit removal is intentional for this request to ensure feature-flag override async storage is directly handled by this reset action.

Target Release Date

N/A

Link to Issue

No issue linked

Code testing

  • Unit tests have been created or updated to cover this change
  • End to end (Detox) tests have been added or updated as needed

Pre-QA Artifacts

Include all artifacts or select not applicable and explain below.

  • Screenshots or screen recording at factory default settings (before and after, if applicable) in portrait orientation
  • Screenshots in landscape orientation
  • Screenshots at 2x text size
  • Screen recording of interaction using VoiceOver (iOS) and/or TalkBack (Android)
  • Visual artifacts not applicable to this PR (explain why 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?

  • Logged in user → Profile/Settings → Developer menu → "Reset async storage".

Feature Flags

  • No new feature flag.
  • Existing remote config feature-flag override storage key is explicitly removed in this reset flow.

Risk Assessment:

  • Low (UI polish, copy change, isolated component)
  • Medium (New feature, non-core path)
  • High (Changes to Core Features: Login, Claims, Rx, Secure Messaging, major updates to a backend service, etc.)

What should QA pay extra attention to?

  • Confirm that using "Reset async storage" clears local data and logs out as before.
  • Confirm feature flag overrides are no longer retained after reset.

Test Review

  • Updated DeveloperScreen.test.tsx reset async storage test to assert AsyncStorage.removeItem('@store_remote_config_overrides') is called.

Test User(s)

  • Any staging user that can access Developer screen.

Checklist for QA

QA Engineer: Check off the items below as you test

  • Shared Test Script executed (post results as a PR comment)
  • Feature-specific verification based on QA Test Context above
  • Tested on iOS
  • Tested on Android

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

@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.

@flagship-mobile-app flagship-mobile-app Bot requested a review from a team May 7, 2026 14:51
@dumathane
Copy link
Copy Markdown
Contributor

Kicking a testflight build to test.

@dumathane dumathane marked this pull request as ready for review May 7, 2026 14:56
Copilot AI review requested due to automatic review settings May 7, 2026 14:56
@dumathane dumathane requested a review from a team as a code owner May 7, 2026 14:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 dispatching logout() to make the reset sequence deterministic.
  • Update DeveloperScreen unit 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.

Comment on lines +162 to 164
await AsyncStorage.removeItem(REMOTE_CONFIG_OVERRIDES_KEY)
await AsyncStorage.clear()
dispatch(logout())
Comment on lines +113 to 114
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)
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants