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

[HOLD for payment 2023-10-10] [$500] Workspace - Opening rate unit workspace page on login displays '0.000' and changing value does not work #26131

Closed
1 of 6 tasks
izarutskaya opened this issue Aug 28, 2023 · 50 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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

Comments

@izarutskaya
Copy link

izarutskaya commented Aug 28, 2023

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


Action Performed:

  1. Open the app
  2. Open settings->workspaces->any workspace->reimbursements->Rate
  3. Copy the URL
  4. Logout and paste the URL
  5. Login and observe that rate is displayed as '0.000'
  6. Change the rate to any value and click save
  7. Observe that app still displays old value and new value is not saved

Expected Result:

App should display correct value on rate unit workspace page on login and save the value if value is changed

Actual Result:

App displays '0.000' as rate on rate unit workspace page on login and on changing and saving the value, it does not change the value

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.57-6

Reproducible in staging?: Y

Reproducible in production?: Y

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

Notes/Photos/Videos: Any additional supporting documentation

rate.appears.as.0.on.login.unit.workspace.mp4
Recording.6043.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692551644917109

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014ad1f796cb41f15e
  • Upwork Job ID: 1696988525560631296
  • Last Price Increase: 2023-08-30
  • Automatic offers:
    • alitoshmatov | Contributor | 26784715
    • dhanashree-sawant | Reporter | 26784718
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 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

@alitoshmatov
Copy link
Contributor

Proposal

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

Opening rate unit workspace page on login displays '0.000' and changing value does not work

What is the root cause of that problem?

The rate data is fetched using Policy.openWorkspaceReimburseView action. This action is triggered when we access Reimbursements page.

When we access rates page with link itself bypassing reimbursement page, this action is not triggered, thus making rate data not available for us.

Also another problem is that if you access it in offline mode or slow internet connection, the data won't be loaded and it shows 0, even if data is loaded if you are in rates page, it won't be updated in TextInput

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

To fetch data when rates page is directly accessed, we can apply something like this, which checks if we have rates data and if not it will try to fetch it:

 componentDidMount() {
        if (lodashGet(this.props, 'policy.customUnits', []).length === 0) {
            BankAccounts.setReimbursementAccountLoading(true);
            Policy.openWorkspaceReimburseView(this.props.policy.id);
        }
    }

We should update inputs when rate data is fetched. I couldn't find any way of modifying input's value, since inputs are using inputID and not value and onValueChange. But I hope there is a way, or we can just use value and onValueChange props.

The another problem with this approach is that when user is modifying inputs and data is fetched it will interrupt user and set input value itself confusing user.
I think we should show some type of loading indicator since user should be aware of that the input data is not available yet but they can change it if they want.

We can maybe utilize pendingActions here by passing reimbursementAccount.isLoading state

pendingAction={lodashGet(distanceCustomUnit, 'pendingAction') || lodashGet(distanceCustomRate, 'pendingAction')}

What alternative solutions did you explore? (Optional)

@samh-nl
Copy link
Contributor

samh-nl commented Aug 29, 2023

Proposal

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

Opening rate unit workspace page on login displays '0.000' and changing value does not work

What is the root cause of that problem?

The reimbursement rate information is loaded in the previous page in fetchData:

BankAccounts.setReimbursementAccountLoading(true);
Policy.openWorkspaceReimburseView(props.policy.id);

However, when accessing the URL directly, fetchData is not called.

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

In WorkspaceRateAndUnitPage.js:

  1. We should load the data on mount, but only if it's not already loading. When going through the normal route via Workspaces, there is no guarantee that loading has finished, so we need to make this conditional.
componentDidMount() {
    if (_.isEmpty(lodashGet(this.props, 'policy.customUnits', {})) && !this.props.isReimbursementAccountLoading) {
        BankAccounts.setReimbursementAccountLoading(true);
        Policy.openWorkspaceReimburseView(this.props.policy.id);
    }
}
  1. Prevent rendering until the data is available. This ensures the input does not stick with the outdated, incorrect value due to defaultValue.
render() {
    ...
+     if (this.props.isReimbursementAccountLoading) {
+         return <FullscreenLoadingIndicator />;  
+     }
    ...
}
  1. Connect using withOnyx to get the loading status of reimbursementAccount.
isReimbursementAccountLoading: {
    key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
    selector: (reimbursementAccount) => lodashGet(reimbursementAccount, 'isLoading', true),
},

What alternative solutions did you explore? (Optional)

N/A

@kevinksullivan kevinksullivan added the External Added to denote the issue can be worked on by a contributor label Aug 30, 2023
@melvin-bot melvin-bot bot changed the title Workspace - Opening rate unit workspace page on login displays '0.000' and changing value does not work [$500] Workspace - Opening rate unit workspace page on login displays '0.000' and changing value does not work Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

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

melvin-bot bot commented Aug 30, 2023

Current assignee @kevinksullivan is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

@kevinksullivan, @rushatgabhane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

@kevinksullivan, @rushatgabhane 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@rushatgabhane
Copy link
Member

reviewing

@melvin-bot melvin-bot bot removed the Overdue label Sep 5, 2023
@rushatgabhane
Copy link
Member

I like @alitoshmatov's proposal #26131 (comment)

C+ reviewed 🎀 👀 🎀

@melvin-bot
Copy link

melvin-bot bot commented Sep 6, 2023

Triggered auto assignment to @cristipaval, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@cristipaval
Copy link
Contributor

I wonder if this is because the offline behaviour is not yet implemented for Distance requests. If I recall correctly, we postponed this due to the tight deadline. @neil-marcellini could you please confirm?

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@cristipaval @kevinksullivan @rushatgabhane this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@cristipaval @kevinksullivan @rushatgabhane this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@cristipaval
Copy link
Contributor

friendly bump @neil-marcellini

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

@cristipaval, @kevinksullivan, @rushatgabhane Whoops! This issue is 2 days overdue. Let's get this updated quick!

@cristipaval
Copy link
Contributor

@rushatgabhane Could you please take care of the checklist? 🙏

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2023
@rushatgabhane
Copy link
Member

WIP ⚠️

  1. The PR that introduced the bug has been identified. Link to the PR:

  2. The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:

  3. A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

  4. Determine if we should create a regression test for this bug.

  5. If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again

@rushatgabhane
Copy link
Member

Created a manual request - https://staging.new.expensify.com/r/495465708926398

@kevinksullivan
Copy link
Contributor

Payment summary

Reporter: @dhanashree-sawant $250
Contributor: @alitoshmatov $500
C+: @rushatgabhane $500

@JmillsExpensify
Copy link

$500 payment approved for @rushatgabhane based on summary above.

@alitoshmatov
Copy link
Contributor

@kevinksullivan Friendly bump, I am also waiting for payment on upwork.

@melvin-bot melvin-bot bot added the Overdue label Oct 23, 2023
@cristipaval
Copy link
Contributor

@kevinksullivan is ooo until 26th. @alitoshmatov are you ok to wait or you want me to reassign someone able to pay?

@melvin-bot melvin-bot bot removed the Overdue label Oct 23, 2023
@alitoshmatov
Copy link
Contributor

That's fine, I will wait till @kevinksullivan is back

@melvin-bot melvin-bot bot added the Overdue label Oct 26, 2023
@kevinksullivan
Copy link
Contributor

@alitoshmatov paid out. @dhanashree-sawant let me know when you accept this offer.

@melvin-bot melvin-bot bot removed the Overdue label Oct 27, 2023
@dhanashree-sawant
Copy link

Thanks @kevinksullivan, I have accepted the offer.

@melvin-bot melvin-bot bot added the Overdue label Oct 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

@cristipaval, @kevinksullivan, @rushatgabhane, @alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@cristipaval
Copy link
Contributor

Are we good to close this one?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 30, 2023
@cristipaval
Copy link
Contributor

friendly bump @kevinksullivan
Is @dhanashree-sawant paid alreayd? Can we close this one?

@melvin-bot melvin-bot bot removed the Overdue label Nov 2, 2023
@dhanashree-sawant
Copy link

@kevinksullivan has sent me the offer but milestone approval is left.

@melvin-bot melvin-bot bot added the Overdue label Nov 6, 2023
@cristipaval
Copy link
Contributor

@kevinksullivan has been OOO, I think he'll be back today. I pinged him internally.

@melvin-bot melvin-bot bot removed the Overdue label Nov 6, 2023
@kevinksullivan
Copy link
Contributor

I'm confused... @dhanashree-sawant can you link the job where it says I need to pay? For whatever reason I don't see you assigned to the original job and it's closed now

https://www.upwork.com/jobs/~014ad1f796cb41f15e

I am not seeing a separate one either. If you can link me to it that would be great. Otherwise I can create a new one.

@dhanashree-sawant
Copy link

This is the message room for that job, not sure if this link will work for you or not but I have sent 'Hi' on upwork in that room
https://www.upwork.com/ab/messages/rooms/room_9b3ffa8158877d7ec9f9b8c997f4fa36?sidebar=true

@kevinksullivan
Copy link
Contributor

all set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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
Projects
None yet
Development

No branches or pull requests

9 participants