Fix canBeMissing: false errors on public pages (sign-in and onboarding)#81441
Merged
Fix canBeMissing: false errors on public pages (sign-in and onboarding)#81441
Conversation
Changed useOnyx call for NVP_ONBOARDING from canBeMissing: false to canBeMissing: true. For new accounts, this key doesn't exist until the backend populates it, causing an error overlay during sign-in/onboarding. Fixes #81440 Co-authored-by: Cursor <cursoragent@cursor.com>
Changed useOnyx calls from canBeMissing: false to canBeMissing: true for: - NVP_TRY_NEW_DOT (6 files) - COUNTRY_CODE (18 files) These keys may not be present in storage for new accounts, causing console errors during sign-in and app usage. Co-authored-by: Cursor <cursoragent@cursor.com>
…Y_CODE" This reverts commit 401bfdc.
The LoginForm uses COUNTRY_CODE with canBeMissing: false, but this key may not be in storage when a user first visits the sign-in page, causing console errors. Changed to canBeMissing: true since it has a default value. Co-authored-by: Cursor <cursoragent@cursor.com>
PopoverReportActionContextMenu is rendered in Expensify.tsx and mounts even before authentication. The BaseReportActionContextMenu component uses NVP_TRY_NEW_DOT which may not be populated yet, causing errors when signed out. Changed to canBeMissing: true since the code already handles undefined safely with optional chaining. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
thienlnam
approved these changes
Feb 4, 2026
Contributor
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
Contributor
|
Failing lint is unrelated |
|
@thienlnam looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Contributor
|
🚧 @thienlnam has triggered a test Expensify/App build. You can view the workflow run here. |
Contributor
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Fixed
canBeMissing: falseerrors that appear on public/pre-authentication pages where Onyx keys may not yet be populated:NVP_ONBOARDINGinReportScreen.tsx: Changed tocanBeMissing: true. For new accounts, this key doesn't exist until the backend populates it during onboarding. The code safely handles undefined with optional chaining:onboarding?.hasCompletedGuidedSetupFlow ?? false.COUNTRY_CODEinBaseLoginForm.tsx: Changed tocanBeMissing: true. On the sign-in page, this key may not be populated yet for first-time visitors. The code already has a default value:[countryCode = CONST.DEFAULT_COUNTRY_CODE].NVP_TRY_NEW_DOTinBaseReportActionContextMenu.tsx: Changed tocanBeMissing: true. ThePopoverReportActionContextMenuis rendered inExpensify.tsxand mounts even before authentication completes. The code already handles undefined safely with optional chaining:!!tryNewDot?.classicRedirect?.dismissed.These errors were only occurring on pages accessible while signed out, where
canBeMissing: falseis inappropriate since Onyx storage may not be fully initialized yet.Fixed Issues
$ #81440
Tests
2026-02-04_12-01-45.mp4
Offline tests
N/A - This fix addresses Onyx key initialization on public pages, not offline behavior.
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Not tested yet - single line changes to Onyx options
Android: mWeb Chrome
Not tested yet - single line changes to Onyx options
iOS: Native
Not tested yet - single line changes to Onyx options
iOS: mWeb Safari
Not tested yet - single line changes to Onyx options
MacOS: Chrome / Safari
Tested locally - sign-in page loads without canBeMissing errors, and onboarding pages load without error overlays.