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-12-05] [$250] Tags - State filed is not auto populated. #52879

Closed
1 of 8 tasks
izarutskaya opened this issue Nov 21, 2024 · 18 comments
Closed
1 of 8 tasks
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

Comments

@izarutskaya
Copy link

izarutskaya commented Nov 21, 2024

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: v9.0.65-1
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

Pre-condition: upload dependent tags in old dot as admin

Dependent.-.Multi.Level.tags.NEW.1.csv

  1. Go to https://staging.new.expensify.com/
  2. Login as employee
  3. Open employee workspace chat
  4. Tap plus icon - create expense
  5. Enter an amount and tap next

Expected Result:

State field must be auto populated.

Actual Result:

State filed is not auto populated.

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Bug6671538_1732170668160.Screenrecorder-2024-11-21-11-47-47-437.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021859625825867558770
  • Upwork Job ID: 1859625825867558770
  • Last Price Increase: 2024-11-21
  • Automatic offers:
    • mkzie2 | Contributor | 105029640
Issue OwnerCurrent Issue Owner: @garrettmknight
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 21, 2024
Copy link

melvin-bot bot commented Nov 21, 2024

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

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Nov 21, 2024
@melvin-bot melvin-bot bot changed the title Tags - State filed is not auto populated. [$250] Tags - State filed is not auto populated. Nov 21, 2024
Copy link

melvin-bot bot commented Nov 21, 2024

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

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

melvin-bot bot commented Nov 21, 2024

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

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Nov 21, 2024
@mkzie2
Copy link
Contributor

mkzie2 commented Nov 21, 2024

Edited by proposal-police: This proposal was edited at 2024-11-22 15:59:14 UTC.

Proposal

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

State filed is not auto populated.

What is the root cause of that problem?

The transaction and transactionDraft are getting from useOnyx. The data can be not available at the first render in IOURequestStepConfirmation

const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`);
const [transactionDraft] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`);

It leads transaction prop is undefined at the first time IOURequestStepConfirmation is rendered

And this useEffect call setMoneyRequestTag with transactionID is -1 here

if (updatedTagsString !== TransactionUtils.getTag(transaction) && updatedTagsString) {
IOU.setMoneyRequestTag(transactionID, updatedTagsString);

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

We have some options to resolve this bug

  1. Introduce transactionID prop in MoneyRequestConfirmationList and pass transactionID={transactionID} from IOURequestStepConfirmation to MoneyRequestConfirmationList and remove this line. We used transactionID from route param in IOURequestStepConfirmation so I think it makes sense if we also use this in MoneyRequestConfirmationList

  1. In this HOC, return the loading screen if the onyx value is loading. Or we can pass isLoadingTransactionValue prop from withFullTransactionOrNotFound to the component. And we can pass this to MoneyRequestConfirmationList through IOURequestStepConfirmation

export default function <TProps extends WithFullTransactionOrNotFoundProps<MoneyRequestRouteName>, TRef>(

Then we can return early in this useEffect if isLoadingTransactionValue is true and run this again after isLoadingTransactionValue is changed to false

if (updatedTagsString !== TransactionUtils.getTag(transaction) && updatedTagsString) {
IOU.setMoneyRequestTag(transactionID, updatedTagsString);

We should do the same for the auto-populated category

What alternative solutions did you explore? (Optional)

We can add transactionID as a dependency here so this useEffect can be triggered again after the current transactionID is updated

if (updatedTagsString !== TransactionUtils.getTag(transaction) && updatedTagsString) {
IOU.setMoneyRequestTag(transactionID, updatedTagsString);

@s77rt
Copy link
Contributor

s77rt commented Nov 21, 2024

I'm not sure I see the bug here. Why must the state be auto populated? is this coming from a regression test? cc @garrettmknight

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 21, 2024

@s77rt If you reload the confirmation page, you can see it's auto-populated. It should be populated if the tag is required and the enabledTags has only one

@s77rt
Copy link
Contributor

s77rt commented Nov 22, 2024

@mkzie2 Thanks for the proposal. Your RCA makes sense but for fixing this I think we should fix the useEffect dependencies as the easiest solution. There is already a comment that we shouldn't add transaction as it will cause the selection multiple times but we can add transactionID. Please test and let me know if that would work.

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 22, 2024

There is already a comment that we shouldn't add transaction as it will cause the selection multiple times but we can add transactionID

@s77rt I just tested this solution and it works well.

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 22, 2024

Updated this as alternative solution.

@s77rt
Copy link
Contributor

s77rt commented Nov 22, 2024

@mkzie2 Thank you! Let's go with that.

🎀 👀 🎀 C+ reviewed
Link to proposal

Copy link

melvin-bot bot commented Nov 22, 2024

Triggered auto assignment to @yuwenmemon, 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 Nov 22, 2024
Copy link

melvin-bot bot commented Nov 22, 2024

📣 @mkzie2 🎉 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 Weekly KSv2 labels Nov 25, 2024
@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Nov 28, 2024
@melvin-bot melvin-bot bot changed the title [$250] Tags - State filed is not auto populated. [HOLD for payment 2024-12-05] [$250] Tags - State filed is not auto populated. Nov 28, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 28, 2024
Copy link

melvin-bot bot commented Nov 28, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Nov 28, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.67-9 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-12-05. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Nov 28, 2024

@s77rt @garrettmknight @s77rt The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@s77rt
Copy link
Contributor

s77rt commented Dec 1, 2024

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: Fix reintroduced dependencies from conflict resolution #41152 (comment)

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: n/a

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Bug requires regression test: No, I think this is coming from testrail already but couldn't find the exact steps, found C2778098 and C2990390

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@garrettmknight garrettmknight moved this from Bugs and Follow Up Issues to Hold for Payment in [#whatsnext] #expense Dec 3, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 5, 2024
@garrettmknight
Copy link
Contributor

Payment Summary:

  • Contributor: @mkzie2 $250 paid via upwork
  • Contributor+: @s77rt $250 via upwork

@s77rt go ahead and request when you're ready.

@github-project-automation github-project-automation bot moved this from Hold for Payment to Done in [#whatsnext] #expense Dec 6, 2024
@JmillsExpensify
Copy link

$250 approved for @s77rt

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
Projects
Status: Done
Development

No branches or pull requests

6 participants