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] [Wave 6: Tags] Tag written as "Parents: Child" appears as "Parents\: Child" #30734

Closed
6 tasks done
izarutskaya opened this issue Nov 1, 2023 · 45 comments
Closed
6 tasks done
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 Nov 1, 2023

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: v1.3.94-0
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
Expensify/Expensify Issue URL:
Issue reported by: Applause-Internal Team
Slack conversation: @

Action Performed:

Precondition: Category with subcategory in the "Parents: Child" format is added to Tags on OD.

  1. Navigate to staging.new.expensify.com.
  2. Go to workspace chat > + > Request money > Manual.
  3. Enter the amount and proceed to confirmation page.
  4. Click Tag.

Expected Result:

Since subcategory is not supported in Tags, the tag in "Parents: Child" format should appear in "Parents: Child" format.

Actual Result:

The tag written as "Parents: Child" appears as "Parents: Child".

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

Bug6259802_1698863541802!Screenshot_2023-11-01_at_10 07 56

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0111054913fb9cbbb1
  • Upwork Job ID: 1719801714306273280
  • Last Price Increase: 2023-11-08
@izarutskaya izarutskaya 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 Nov 1, 2023
@melvin-bot melvin-bot bot changed the title Tags - Tag written as "Parents: Child" appears as "Parents\: Child" [$500] Tags - Tag written as "Parents: Child" appears as "Parents\: Child" Nov 1, 2023
Copy link

melvin-bot bot commented Nov 1, 2023

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

Copy link

melvin-bot bot commented Nov 1, 2023

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

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

melvin-bot bot commented Nov 1, 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

Copy link

melvin-bot bot commented Nov 1, 2023

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

@FitseTLT
Copy link
Contributor

FitseTLT commented Nov 1, 2023

Proposal

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

"Parent:Child" form of a tag will appear "Parent/:Child" in Tag list

What is the root cause of that problem?

Tag text sent from the server is with the slash included "Parent/:Child", it must related to some escaping code in the back end.

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

It might need to be solved from backend but we can also remove the slash before we display it on the frontend.
And the perfect place to do that I think is here:
Change this code

function getTagsOptions(tags) {
return _.map(tags, (tag) => ({
text: tag.name,
keyForList: tag.name,
searchText: tag.name,
tooltipText: tag.name,
isDisabled: !tag.enabled,
}));
}

to


function getTagsOptions(tags) {
    return _.map(tags, (tag) => {
        const slashRemoved = removeSlash(tag.name);
        return {
            text: slashRemoved,
            keyForList: slashRemoved,
            searchText: slashRemoved,
            tooltipText: slashRemoved,
            isDisabled: !tag.enabled,
        };
    });
}

function removeSlash(tag) {
    return tag.replace(/(\\)+/g, '');
}

What alternative solutions did you explore? (Optional)

@saranshbalyan-1234
Copy link
Contributor

Proposal

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

Tag written as "Parents: Child" appears as "Parents: Child"

What is the root cause of that problem?

This is due the issue of getting escape character while saving a category app is introducing escape characters.

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

While creating a new category, which i think is not there in new dot, it is there in old dot, we have to remove escape characters either from frontend or from backend

What alternative solutions did you explore? (Optional)

Remove escape characters from new dot while showing it on UI
N/A

@MrJithil
Copy link

MrJithil commented Nov 2, 2023

Proposal

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

The escape character showing in multi level tags.

What is the root cause of that problem?

In Old Dot, to create multiple line tags, we need to upload the file in csv. As per the system design, to add a tag with ":" in it, we need to add a single "" in order to do so.

This tags are rendering the extra \ in the tag text.

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

In the
src/components/OptionRow.js

we are getting the const text = lodashGet(props.option, 'text', ''); After this, there are rule sets like fullTitle, indentsLength etc being run.
Here, we will introduce a new line const escapedText = text.replace(<regex>, '')

What alternative solutions did you explore? (Optional)

Write escaping inside the options map.

function getTagsOptions(tags) {
    return _.map(tags, (tag) => ({
        text: tag.name.replace(<regex>, '',) // here the tags list will convert to the tags options
        keyForList: tag.name,
        searchText: tag.name,
        tooltipText: tag.name,
        isDisabled: !tag.enabled,
    }));
}

We should not touch the other places of getTagsOptions map.

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@CortneyOfstad
Copy link
Contributor

Getting engineering eyes on this and we've had issues with this in the past but it is usually caused by strange characters in the tag names.

Copy link

melvin-bot bot commented Nov 2, 2023

Triggered auto assignment to @youssef-lr (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

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

melvin-bot bot commented Nov 6, 2023

@youssef-lr, @CortneyOfstad, @jjcoffee Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@jjcoffee
Copy link
Contributor

jjcoffee commented Nov 6, 2023

@CortneyOfstad Just to clarify are we waiting for @youssef-lr to look into this, or shall I still go ahead with reviewing proposals?

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

I believe we should wait on @youssef-lr for to review, just to be safe 👍

Copy link

melvin-bot bot commented Nov 8, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@puneetlath puneetlath changed the title [$500] Tags - Tag written as "Parents: Child" appears as "Parents\: Child" [$500] [Wave 6: Tags] Tag written as "Parents: Child" appears as "Parents\: Child" Nov 9, 2023
@melvin-bot melvin-bot bot added the Overdue label Nov 9, 2023
@CortneyOfstad
Copy link
Contributor

@youssef-lr bump — thanks!

@melvin-bot melvin-bot bot removed the Overdue label Nov 9, 2023
@melvin-bot melvin-bot bot added the Daily KSv2 label Nov 30, 2023
@CortneyOfstad
Copy link
Contributor

@FitseTLT @jjcoffee — I've sent you both offers in Upwork for this job. Please let me know once you accept and I can get this paid — thanks!

@jjcoffee
Copy link
Contributor

@CortneyOfstad Accepted, thanks! Just a heads up in case you missed it - there was a regression here.

@CortneyOfstad
Copy link
Contributor

@jjcoffee thanks for the heads up! Will adjust the title to reflect that. Thanks!

@CortneyOfstad CortneyOfstad changed the title [HOLD for payment 2023-11-30] [$500] [Wave 6: Tags] Tag written as "Parents: Child" appears as "Parents\: Child" [HOLD for payment 2023-12-7] [$500] [Wave 6: Tags] Tag written as "Parents: Child" appears as "Parents\: Child" Dec 1, 2023
@melvin-bot melvin-bot bot added the Overdue label Dec 4, 2023
@CortneyOfstad
Copy link
Contributor

Not overdue 👍

@melvin-bot melvin-bot bot removed the Overdue label Dec 4, 2023
@jjcoffee
Copy link
Contributor

jjcoffee commented Dec 5, 2023

Working through another regression, unfortunately! #32203

@CortneyOfstad CortneyOfstad changed the title [HOLD for payment 2023-12-7] [$500] [Wave 6: Tags] Tag written as "Parents: Child" appears as "Parents\: Child" [HOLD for #32203] [$500] [Wave 6: Tags] Tag written as "Parents: Child" appears as "Parents\: Child" Dec 6, 2023
@jjcoffee
Copy link
Contributor

jjcoffee commented Dec 6, 2023

#32203 is no longer replicable, I think we can take this back off hold @CortneyOfstad.

@melvin-bot melvin-bot bot added the Overdue label Dec 8, 2023
@roryabraham roryabraham changed the title [HOLD for #32203] [$500] [Wave 6: Tags] Tag written as "Parents: Child" appears as "Parents\: Child" [$500] [Wave 6: Tags] Tag written as "Parents: Child" appears as "Parents\: Child" Dec 9, 2023
@roryabraham
Copy link
Contributor

@izarutskaya Can we please retest this issue? Also requested retest in slack: https://expensify.slack.com/archives/C9YU7BX5M/p1702088246126149

@melvin-bot melvin-bot bot removed the Overdue label Dec 9, 2023
@roryabraham
Copy link
Contributor

This appears to have been fixed. Can anyone else confirm?

@melvin-bot melvin-bot bot added the Overdue label Dec 11, 2023
@jjcoffee
Copy link
Contributor

Working fine for me! There is some discussion though regarding not correctly escaping the tags when sending back to the server (which is what oldDot does).

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 11, 2023
@CortneyOfstad
Copy link
Contributor

Do we feel comfortable closing this in favor of #32203 (comment) since the scope of the issue has not changed @roryabraham @jjcoffee?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 13, 2023
@melvin-bot melvin-bot bot removed the Overdue label Dec 18, 2023
@lanitochka17
Copy link

Issue is still reproducible on the latest build 1.4.30-0

20240123_222449.mp4

@lanitochka17 lanitochka17 reopened this Jan 23, 2024
@jjcoffee
Copy link
Contributor

@lanitochka17 Thanks for raising! We'll be handling on #32203 instead, so this can be closed.

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
No open projects
Development

No branches or pull requests

9 participants