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 2024-09-3][$125] Categorizing - Distance rate list is empty when workspace is non-existent during categorizing #46008

Closed
6 tasks done
lanitochka17 opened this issue Jul 23, 2024 · 31 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 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 23, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.10-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • Account has no workspace
  1. Go to staging.new.expensify.com
  2. Go to self DM
  3. Track a distance expense
  4. Click Categorize it
  5. Select a category
  6. Proceed to confirmation page
  7. Click Rate on confirmation page

Expected Result:

Rate list should display the workspace distance rate

Actual Result:

Rate list is empty
This issue only happens when there is no workspace in the account

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

Add any screenshot/video evidence

Bug6549648_1721664230739.bandicam_2024-07-22_23-48-57-217.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b13e9e624d638835
  • Upwork Job ID: 1818860377251381062
  • Last Price Increase: 2024-08-30
  • Automatic offers:
    • dominictb | Contributor | 103403381
Issue OwnerCurrent Issue Owner: @allroundexperts
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 23, 2024
Copy link

melvin-bot bot commented Jul 23, 2024

Triggered auto assignment to @adelekennedy (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.

@lanitochka17
Copy link
Author

@adelekennedy FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp

@dominictb
Copy link
Contributor

dominictb commented Jul 23, 2024

Proposal

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

Rate list is empty
This issue only happens when there is no workspace in the account

What is the root cause of that problem?

There're 2 problems:

  1. We're getting rates from policy

It's not correct, since after users click categorize it, we just create the draft policy -> rates are undefined

  1. In MoneyRequestConfirmationList we're getting mileageRates so it will be empty object

key: ({policyID}) => `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,

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

  1. we should get the policyDraft and rateDrafts and get the actual policy/rates as what we already did in here

In IOURequestStepDistanceRate

    const policy = policyReal ?? policyDraft
    const rates = isEmpty(rates) ? rateDrafts : rates

... 
const IOURequestStepDistanceRateWithOnyx = withOnyx<IOURequestStepDistanceRateProps, IOURequestStepDistanceRateOnyxProps>({
...
export default withOnyx<MoneyRequestConfirmationListProps, MoneyRequestConfirmationListOnyxProps>({
...
    policyDraft: {
        key: ({reportDraft, transaction}) => `${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${IOU.getIOURequestPolicyID(transaction, reportDraft)}`,
    },
    rateDrafts: {
        key: ({reportDraft, transaction}) => `${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${IOU.getIOURequestPolicyID(transaction, reportDraft)}`,
        selector: (policy: OnyxEntry<Policy>) => DistanceRequestUtils.getMileageRates(policy),
    },

  1. Get the draft mileageRates
    In MoneyRequestConfirmationList
    const mileageRates = isEmpty(mileageRatesReal) ? mileageRatesDraft: mileageRatesReal;
...

...
    mileageRatesDraft: {
        key: ({policyID}) => `${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${policyID}`,
        selector: (policy: OnyxEntry<OnyxTypes.Policy>) => DistanceRequestUtils.getMileageRates(policy),
    },

What alternative solutions did you explore? (Optional)

NA

Result

web-resize.mp4

@melvin-bot melvin-bot bot added the Overdue label Jul 25, 2024
Copy link

melvin-bot bot commented Jul 26, 2024

@adelekennedy Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Jul 30, 2024

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

@adelekennedy adelekennedy added the External Added to denote the issue can be worked on by a contributor label Aug 1, 2024
@melvin-bot melvin-bot bot changed the title Categorizing - Distance rate list is empty when workspace is non-existent during categorizing [$250] Categorizing - Distance rate list is empty when workspace is non-existent during categorizing Aug 1, 2024
Copy link

melvin-bot bot commented Aug 1, 2024

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

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

melvin-bot bot commented Aug 1, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Aug 1, 2024
@allroundexperts
Copy link
Contributor

@dominictb's proposal looks good to me. It has the correct RCA and the proposed solution works as well.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Aug 4, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 5, 2024
Copy link

melvin-bot bot commented Aug 5, 2024

📣 @dominictb 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 6, 2024
Copy link

melvin-bot bot commented Aug 26, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Aug 29, 2024
Copy link

melvin-bot bot commented Aug 29, 2024

This issue has not been updated in over 15 days. @tgolen, @allroundexperts, @adelekennedy, @dominictb eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@tgolen
Copy link
Contributor

tgolen commented Aug 30, 2024

Monthly Update

  • I think this is still trying to get finished up. The initial fix caused a regression that lead to the app crashing

Next Steps

  • @tgolen wait a few more days to ensure the regression period has passed for the latest PR that fixed the crashing
  • @tgolen bump this issue up to weekly priority so I don't forget about it next week
  • @tgolen reduce pay by 50% for regression

ETA

  • Closed out by Wednesday, Sep 4

@tgolen tgolen changed the title [$250] Categorizing - Distance rate list is empty when workspace is non-existent during categorizing [$125] Categorizing - Distance rate list is empty when workspace is non-existent during categorizing Aug 30, 2024
Copy link

melvin-bot bot commented Aug 30, 2024

Upwork job price has been updated to $125

@ikevin127
Copy link
Contributor

Coming from @tgolen's comment in #47914 (comment), since that issue was closed and ⚠️ automation did not kick in here for the 2nd (regression) PR which I reviewed as C+ and require payment for -> this should be on [HOLD for Payment 2024-09-3] according to 4 days ago production deploy from #48016 (comment).

cc @adelekennedy

@adelekennedy adelekennedy changed the title [$125] Categorizing - Distance rate list is empty when workspace is non-existent during categorizing [HOLD for Payment 2024-09-3][$125] Categorizing - Distance rate list is empty when workspace is non-existent during categorizing Aug 30, 2024
@adelekennedy adelekennedy added the Awaiting Payment Auto-added when associated PR is deployed to production label Aug 30, 2024
@adelekennedy
Copy link

It sounds like the only payments due here are for the PR review from @ikevin127

@allroundexperts
Copy link
Contributor

I think I might be eligible for half the payment since I reviewed the original PR.

@ikevin127
Copy link
Contributor

ikevin127 commented Sep 3, 2024

cc @adelekennedy For payments today since the issue has Monthly label and might've got buried.

@ikevin127
Copy link
Contributor

@adelekennedy Bump for payment 💸

@ikevin127
Copy link
Contributor

@adelekennedy Bump for payment, day 3 🙈

@melvin-bot melvin-bot bot added Daily KSv2 and removed Monthly KSv2 labels Sep 6, 2024
@adelekennedy
Copy link

adelekennedy commented Sep 6, 2024

Payouts due:

@ikevin127
Copy link
Contributor

@adelekennedy Offer accepted, thank you! 💯

@dominictb
Copy link
Contributor

Hi @adelekennedy, I'm also due payment here as I'm the assigned contributor who raised the PR for this issue.

Could you please take a look? 🙏

@JmillsExpensify
Copy link

$125 approved for @allroundexperts

@JmillsExpensify
Copy link

Re-opening based on the comment from @dominictb

@adelekennedy
Copy link

@dominictb that's my bad! Will you apply to this job for payment? I can't find your profile in Upwork for some reason

@adelekennedy
Copy link

Bump @dominictb

@dominictb
Copy link
Contributor

@adelekennedy Ah sorry for missing this, I applied

@adelekennedy
Copy link

adelekennedy commented Oct 22, 2024

Offer sent @dominictb!

@dominictb
Copy link
Contributor

@adelekennedy Thanks, I accepted that, we're good to proceed and close

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 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

7 participants