Skip to content
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

[$500] Web - Wallet - Error when running code in /settings/wallet/card/expensify page #30390

Closed
1 of 6 tasks
lanitochka17 opened this issue Oct 25, 2023 · 7 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 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

@lanitochka17
Copy link

lanitochka17 commented Oct 25, 2023

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: 1.3.91-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause = Internal Team
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com/settings/wallet/card/expensify
  2. Paste the following code in JS console

Onyx.merge(cardList, {
5678: {
cardID: 5678,
state: 4,
bank: '1000',
availableSpend: 10000,
domainName: 'Expensify',
lastFourPAN: '2345',
isVirtual: true,
},
});

Expected Result:

The code is run successfully

Actual Result:

An error shows up
VM2042:1 Uncaught ReferenceError: Onyx is not defined
at :1:1

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Bug6250769_1698261359255.bandicam_2023-10-26_01-49-14-986.mp4
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0182685be16e5283ed
  • Upwork Job ID: 1717277416063586304
  • Last Price Increase: 2023-10-25
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot changed the title Web - Wallet - Error when running code in /settings/wallet/card/expensify page [$500] Web - Wallet - Error when running code in /settings/wallet/card/expensify page Oct 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

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

@alitoshmatov
Copy link
Contributor

I am confused, why this is an issue? Would be great if someone could explain it in more details

@iiredalert
Copy link

iiredalert commented Oct 25, 2023

Proposal

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

Unable to use the Onyx global variable in the console in the staging envrionemnt.

What is the root cause of that problem?

We are not setting the global Onyx variable for the staging environment, it is only set for the development environment:

App/src/App.js

Lines 32 to 34 in d4d9f78

if (window && Environment.isDevelopment()) {
window.Onyx = Onyx;
window.setSupportToken = Session.setSupportAuthToken;

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

We can add a check to see if we're in the staging environment:

// For easier debugging and development, when we are in web we expose Onyx to the window, so you can more easily set data into Onyx
if (window && (Environment.isDevelopment() || Environment.IsStaging())) {
    window.Onyx = Onyx;
    window.setSupportToken = Session.setSupportAuthToken;
}

Then add the following function in Environment.js:

function isStaging() {
    return lodashGet(Config, 'ENVIRONMENT', CONST.ENVIRONMENT.STAGING) === CONST.ENVIRONMENT.STAGING;
}

What alternative solutions did you explore? (Optional)

@stephanieelliott
Copy link
Contributor

Yeah considering this is not an issue that an end user would run into and we deployed as scheduled, I think this can be closed.

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

5 participants