-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Problem
The "No data found for key nvp_onboarding" error has recurred, even though the original issue #64994 was fixed and closed. This is a regression caused by a different location using canBeMissing: false with the NVP_ONBOARDING Onyx key.
Root Cause
In src/pages/inbox/ReportScreen.tsx line 187:
const [onboarding] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {canBeMissing: false});The canBeMissing: false option causes Onyx to throw an error when NVP_ONBOARDING is not present in storage. For new accounts, this key doesn't exist until the backend populates it, resulting in the error overlay during sign-in/onboarding.
Impact
- New account sign-up shows error overlay
- Development experience is disrupted by repeated error messages
- Affects all platforms (Web, iOS, Android)
Fix
Change canBeMissing: false to canBeMissing: true in ReportScreen.tsx. The code already handles undefined safely with optional chaining:
const isOnboardingCompleted = onboarding?.hasCompletedGuidedSetupFlow ?? false;Related Issue: #64994 (original bug, now closed)
Version: 9.3.11-49 (main branch)
Reproducible in staging: Yes
Reproducible in production: TBD
Steps to Reproduce
- Navigate to https://staging.new.expensify.com/ or local dev server
- Sign in with a new email address
- Enter magic code
- Observe error overlay "No data found for key nvp_onboarding"
Expected Result
No error should appear during sign-in with a new account.
Actual Result
Error overlay appears: "No data found for key nvp_onboarding"