Skip to content

"No data found for key nvp_onboarding" error regression in ReportScreen.tsx #81440

@neil-marcellini

Description

@neil-marcellini

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

  1. Navigate to https://staging.new.expensify.com/ or local dev server
  2. Sign in with a new email address
  3. Enter magic code
  4. 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"

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ReviewingHas a PR in review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions