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-12] [$250] Categories - GL code data disappears after importing same file that does not have GL code #48587

Closed
6 tasks done
IuliiaHerets opened this issue Sep 4, 2024 · 16 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 Reviewing Has a PR in review

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 4, 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: 9.0.29-5
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Control workspace settings > Categories.
  3. Click 3-dot menu.
  4. Click Import spreadsheet.
  5. Upload the attached CSV file.
  6. Map Name and Enabled.
  7. Click Import.
  8. Click on any category.
  9. Manually enter GL code and Payroll code.
  10. Click 3-dot menu > Import spreadsheet.
  11. Upload the same file in Step 5, map the fields and import.
  12. Click on the same category that has GL code and Payroll code entered previously in Step 9.

Expected Result:

GL code and Payroll code will remain unchanged after importing the same file that does not have GL code and Payroll code (Old Dot behavior).

Actual Result:

GL code data disappears while Payroll code remains after importing the same file that does not have GL code and Payroll code.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6593258_1725473988663.bandicam_2024-09-05_02-12-43-480.mp4

Bug6593258_1725473988736!real_table_cat.csv

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021831644707096192237
  • Upwork Job ID: 1831644707096192237
  • Last Price Increase: 2024-09-05
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @sonialiap
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 4, 2024
Copy link

melvin-bot bot commented Sep 4, 2024

Triggered auto assignment to @sonialiap (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 Sep 4, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Sep 4, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 4, 2024
Copy link
Contributor

github-actions bot commented Sep 4, 2024

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

@tgolen tgolen assigned tgolen and sonialiap and unassigned tgolen and sonialiap Sep 4, 2024
@tgolen
Copy link
Contributor

tgolen commented Sep 4, 2024

Sorry, I didn't mean to unassign anyone.

@filip-solecki I believe this is related to #47827 so can you please look into this?

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 4, 2024

Proposal

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

Categories - GL code data disappears after importing same file that does not have GL code

What is the root cause of that problem?

Here when we process imported categories, and GL code is missing we default it to emptystring ''

const categories = categoriesNames?.slice(containsHeader ? 1 : 0).map((name, index) => ({
name,
enabled: categoriesEnabledColumn !== -1 ? categoriesEnabled?.[containsHeader ? index + 1 : index] === 'true' : true,
// eslint-disable-next-line @typescript-eslint/naming-convention
'GL Code': categoriesGLCodeColumn !== -1 ? categoriesGLCode?.[containsHeader ? index + 1 : index] : '',
}));

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

we should check if we have a existing category with same name, if yes then also check if category has a GL code and we should use that if imported category dont has one

const categories = categoriesNames?.slice(containsHeader ? 1 : 0).map((name, index) => {
            const categoryAlreadyExists = policyCategories?.[name];
            const existingGLCodeOrDefault = categoryAlreadyExists?.['GL Code'] ?? '';
            return {
                name,
                enabled: categoriesEnabledColumn !== -1 ? categoriesEnabled?.[containsHeader ? index + 1 : index] === 'true' : true,
                // eslint-disable-next-line @typescript-eslint/naming-convention
                'GL Code': categoriesGLCodeColumn !== -1 ? categoriesGLCode?.[containsHeader ? index + 1 : index] : existingGLCodeOrDefault,
            };
        });
Screen.Recording.2024-09-05.at.2.22.33.AM.mov

Copy link
Contributor

github-actions bot commented Sep 4, 2024

@ishpaul777 Your proposal will be dismissed because you did not follow the proposal template.

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 4, 2024

Propsal updated

fixed a typo, used proper format

@Shahidullah-Muffakir
Copy link
Contributor

@ishpaul777 I have a question: When processing the imported categories, we aren't adding the check you mentioned for the Payroll Code. However, the Payroll Code still seems correct after re-uploading the same file. are we handling that somewhere else? Thank you.

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 4, 2024

I guess thats because we get it as Onyxupdate from BE (i could be wrong)

Screenshot 2024-09-05 at 2 52 38 AM

@Shahidullah-Muffakir
Copy link
Contributor

Right, yes, that makes sense. Thanks.

@melvin-bot melvin-bot bot added the Weekly KSv2 label Sep 5, 2024
@mountiny mountiny added External Added to denote the issue can be worked on by a contributor Hourly KSv2 and removed Reviewing Has a PR in review Weekly KSv2 labels Sep 5, 2024
Copy link

melvin-bot bot commented Sep 5, 2024

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

@melvin-bot melvin-bot bot changed the title Categories - GL code data disappears after importing same file that does not have GL code [$250] Categories - GL code data disappears after importing same file that does not have GL code Sep 5, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 5, 2024
Copy link

melvin-bot bot commented Sep 5, 2024

Current assignees @rushatgabhane and @ishpaul777 are eligible for the External assigner, not assigning anyone new.

@mountiny mountiny added Reviewing Has a PR in review and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Sep 5, 2024
@mountiny
Copy link
Contributor

mountiny commented Sep 5, 2024

Payment summary:

  • $250 to @ishpaul777 for a fix
  • no payment to Rushat as he is going to be paid on the project basis

@mountiny mountiny added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Sep 5, 2024
@sonialiap
Copy link
Contributor

Deployed to staging, waiting for production deploy and then 7 days

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 6, 2024

Deployed prod yesterday, automation failed to update issue,[HOLD for Payment 12 sept]

@sonialiap sonialiap changed the title [$250] Categories - GL code data disappears after importing same file that does not have GL code [Hold for payment 2024-09-12] [$250] Categories - GL code data disappears after importing same file that does not have GL code Sep 6, 2024
@sonialiap
Copy link
Contributor

sonialiap commented Sep 12, 2024

Payment summary:

  • @ishpaul777 $250 - offer sent in upwork - paid ✔️
  • no payment to Rushat as he is going to be paid on the project basis

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 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

7 participants