Skip to content

[$250] Onboarding - Onyx console error when opening onboarding task #60991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 8 tasks
mitarachim opened this issue Apr 28, 2025 · 12 comments
Closed
1 of 8 tasks

[$250] Onboarding - Onyx console error when opening onboarding task #60991

mitarachim opened this issue Apr 28, 2025 · 12 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@mitarachim
Copy link

mitarachim commented Apr 28, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.1.33-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Other

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a new Gmail account.
  3. Select Skip on work email step.
  4. Select Track and budget expenses.
  5. Complete the onboarding.
  6. Go to Concierge.
  7. Click on any onboarding task.

Expected Result:

There will be no console error after opening onboarding task.

Actual Result:

Console error shows up after opening onboarding task - useOnyx returned no data for key with canBeMissing set to false.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6815710_1745876543875.20250429_053923.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021917140769149861958
  • Upwork Job ID: 1917140769149861958
  • Last Price Increase: 2025-04-29
Issue OwnerCurrent Issue Owner: @eh2077
@mitarachim mitarachim added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 DeployBlocker Indicates it should block deploying the API DeployBlockerCash This issue or pull request should block deployment labels Apr 28, 2025
Copy link

melvin-bot bot commented Apr 28, 2025

Triggered auto assignment to @flaviadefaria (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

Copy link

melvin-bot bot commented Apr 28, 2025

Triggered auto assignment to @Julesssss (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Apr 28, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 28, 2025
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@Julesssss
Copy link
Contributor

Not a user-facing error.

@Julesssss Julesssss added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 DeployBlocker Indicates it should block deploying the API labels Apr 28, 2025
@flaviadefaria
Copy link
Contributor

Cool, adding the external label so this can be fixed.

@flaviadefaria flaviadefaria added the External Added to denote the issue can be worked on by a contributor label Apr 29, 2025
@melvin-bot melvin-bot bot changed the title Onboarding - Onyx console error when opening onboarding task [$250] Onboarding - Onyx console error when opening onboarding task Apr 29, 2025
Copy link

melvin-bot bot commented Apr 29, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021917140769149861958

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 29, 2025
Copy link

melvin-bot bot commented Apr 29, 2025

Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 (External)

@nkdengineer
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Console error shows up after opening onboarding task - useOnyx returned no data for key with canBeMissing set to false.

What is the root cause of that problem?

This comes from this line, for the created action that isn't created action of the transaction thread report, transactionID is 0 or undefined, and transaction can be undefined but canBeMissing here is false.

const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {canBeMissing: false});

The same problem for other places here

const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {canBeMissing: false});

const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {canBeMissing: false});

What changes do you think we should make in order to solve the problem?

Update canBeMissing for these places to true

const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {canBeMissing: false});

const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {canBeMissing: false});

const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {canBeMissing: false});

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

None

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@dmkt9
Copy link
Contributor

dmkt9 commented Apr 29, 2025

Proposal

Please re-state the problem that we are trying to solve in this issue.

Console error shows up after opening onboarding task - useOnyx returned no data for key with canBeMissing set to false.

What is the root cause of that problem?

The error originates from useOnyx hooks with canBeMissing: false in these components:

const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {canBeMissing: false});

const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {canBeMissing: false});

const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {canBeMissing: false});

What changes do you think we should make in order to solve the problem?

We use canBeMissing: false to enforce safety, but these components inherit data from parent hooks that use canBeMissing: true. Thus, we can safely set canBeMissing: true for the problematic hooks:

  • ReportActionItemContentCreated and BaseReportActionContextMenu inherit from:
    const [transactionThreadReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`, {
    selector: (reportActions: OnyxEntry<OnyxTypes.ReportActions>) => getSortedReportActionsForDisplay(reportActions, canUserPerformWriteAction(report), true),
    canBeMissing: true,
    });
  • AttachmentModal inherits from:
    const [reportOnyx] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportIDFromRoute}`, {allowStaleData: true, canBeMissing: true});

By aligning the canBeMissing flag with the parent components, we resolve the console error while maintaining data integrity.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

NA

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@eh2077
Copy link
Contributor

eh2077 commented Apr 29, 2025

This is related to this epic #58499

The Growl alert will be used after this PR #61056

I think there're many alerts need to be handle. It'll be better to have a holistic solution or just have a single PR to fix all.

@iwiznia I found this open PR #61047 is going to fix a bunch of cases, does it make sense to let that PR fix this issue together?

@Julesssss
Copy link
Contributor

I think there're many alerts need to be handle. It'll be better to have a holistic solution or just have a single PR to fix all.

Yeah agree. I think we should just close this issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

6 participants