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-11-17][$500] XOF currency not searchable by its second term #29345

Closed
6 tasks done
kbecciv opened this issue Oct 11, 2023 · 41 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

@kbecciv
Copy link

kbecciv commented Oct 11, 2023

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: 1.3.80.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: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696929897419459

Action Performed:

  1. Open the app
  2. Click on green plus and click request money->manual
  3. Click on select a currency
  4. Search 'X' and observe that there are 2 currencies (XAF, XOF) with 'FCFA' as second term
  5. Search with 'FCFA' and observe that it does not display XOF in results
  6. Remove F from start, observe that second term of XOF has space after 'F'
  7. Search FCFA with space after first 'F' i.e. 'F CFA' and observe that even now, XOF is not displayed

Expected Result:

Currencies should be searchable by both formats as displayed in list

Actual Result:

XOF is not searchable using it second term i.e. the text displayed after

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

Android: Native
android.native.XOF.not.searchable.by.second.term.mp4
Android: mWeb Chrome
android.chrome.XOF.not.searchable.by.second.term.mp4
iOS: Native
ios.native.XOF.not.searchable.by.second.term.mov
iOS: mWeb Safari
ios.safari.XOF.not.searchable.by.second.term.mov
MacOS: Chrome / Safari
Recording.4935.mp4
windows.chrome.XOF.not.searchable.by.second.term.mp4
MacOS: Desktop
mac.desktop.XOF.not.searchable.by.second.term.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019305a629853b75cc
  • Upwork Job ID: 1712154287463485440
  • Last Price Increase: 2023-10-25
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 27472202
    • ZhenjaHorbach | Contributor | 27472206
    • dhanashree-sawant | Reporter | 27472207
Issue OwnerCurrent Issue Owner: @laurenreidexpensify
@kbecciv kbecciv 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 Oct 11, 2023
@melvin-bot melvin-bot bot changed the title XOF currency not searchable by its second term [$500] XOF currency not searchable by its second term Oct 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 11, 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

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

melvin-bot bot commented Oct 11, 2023

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

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Oct 11, 2023

Proposal

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

XOF is not searchable using it second term i.e. the text displayed after

What is the root cause of that problem?

The main problem is that we are looking for a currency without any formatting
And in this case, it may not be correct
But logical
Because FCFA != F CFA

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

To fix this bug we can delete all spaces from currencyOptions and searchValue when we filter options

const filteredCurrencies = _.filter(currencyOptions, (currencyOption) => searchRegex.test(currencyOption.text) || searchRegex.test(currencyOption.currencyName));

We can update this line like

const filteredCurrencies = _.filter(currencyOptions, (currencyOption) => searchRegex.test(currencyOption.text.replace(/\s/g, '')) || searchRegex.test(currencyOption.currencyName.replace(/\s/g, '')));

const filteredCurrencies = _.filter(currencyOptions, (currencyOption) => searchRegex.test(currencyOption.text) || searchRegex.test(currencyOption.currencyName));

To be sure that spaces will not interfere with our search

Plus It would also be nice to format the string that we use in the search value

For this, we can update this line like

const searchRegex = new RegExp(Str.escapeForRegExp(searchValue.replace(/\s/g, '')), 'i');

const searchRegex = new RegExp(Str.escapeForRegExp(searchValue.trim()), 'i');

Also we can use replaceAll(' ','') to delete all spaces

What alternative solutions did you explore? (Optional)

NA

@yh-0218
Copy link
Contributor

yh-0218 commented Oct 11, 2023

Proposal

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

XOF currency not searchable by its second term

What is the root cause of that problem?

This is currency list issue, correctly database or third party issue.
Let's check currency text again.

XOF - F CFA         convert to ascii      88 79 70 32 45 32 70 226 128 175 67 70 65

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

Option1 - update currency list to 88 79 70 32 45 32 70 32 67 70 65
Option2 - replace searchRegex.test(currencyOption.text.replace(' ', ' '))
Screenshot 2023-10-11 at 9 04 15 PM
Option3 - If we need to search without space, then replace special letter to ''

Screen.Recording.2023-10-11.at.9.07.00.PM.mov

What alternative solutions did you explore? (Optional)

@Vadym-33
Copy link

Proposal

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

XOF currency not searchable by its second term

What is the root cause of that problem?

This is currency list issue
XOF - F CFA convert to ascii 88 79 70 32 45 32 70 226 128 175 67 70 65

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

we can update like this.

const filteredCurrencies = _.filter(currencyOptions, (currencyOption) =>
 searchRegex.test(currencyOption.text.replace(/\s/g, ' ')) ||
 searchRegex.test(currencyOption.currencyName.replace(/\s/g, ' ')));

const filteredCurrencies = _.filter(currencyOptions, (currencyOption) => searchRegex.test(currencyOption.text) || searchRegex.test(currencyOption.currencyName));

What alternative solutions did you explore? (Optional)

@laurenreidexpensify
Copy link
Contributor

@abdulrahuman5196 a few proposals to consider here ^^

@abdulrahuman5196
Copy link
Contributor

Reviewing now

@abdulrahuman5196
Copy link
Contributor

abdulrahuman5196 commented Oct 13, 2023

@yh-0218

Option1 - update currency list to 88 79 70 32 45 32 70 32 67 70 65

How do you plan to do this? Kindly always include the implementation details as part of the proposals.

@yh-0218
Copy link
Contributor

yh-0218 commented Oct 13, 2023

@abdulrahuman5196 Thanks for your replyl.
If we have that list on DB, then we can make correctly on DB.
If that is third party data, then we can do searchRegex.test(currencyOption.text.replace(/\s/g, ' '))

@abdulrahuman5196
Copy link
Contributor

@abdulrahuman5196 Thanks for your replyl. If we have that list on DB, then we can make correctly on DB. If that is third party data, then we can do searchRegex.test(currencyOption.text.replace(/\s/g, ' '))

@yh-0218 This is to be diagnosed by contributor and provide functionality implementation path as part of their changes proposed. Kindly update the proposal with implementation details of the option.

@yh-0218
Copy link
Contributor

yh-0218 commented Oct 15, 2023

@abdulrahuman5196 Could you check option2 on my proposal
We can use replaceAll function like screen shot

@yh-0218
Copy link
Contributor

yh-0218 commented Oct 16, 2023

@abdulrahuman5196
I have some ways to replace Non Breaking Space to Space

replaceAll('\u{202F}', ' ')     // Non-breaking-space in unicode.

or

replace(/\s/g, ' ')     // This will change all space and non-breaking-space to space

@melvin-bot
Copy link

melvin-bot bot commented Oct 18, 2023

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

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

melvin-bot bot commented Oct 18, 2023

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

@laurenreidexpensify
Copy link
Contributor

@abdulrahuman5196 what ya reckon ^^

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 18, 2023
@laurenreidexpensify
Copy link
Contributor

@abdulrahuman5196 bump ^

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

Sorry for the delay. Reviewing now

@abdulrahuman5196
Copy link
Contributor

REviewing now

@abdulrahuman5196
Copy link
Contributor

All proposals point to whitespace replace during search. I checked and it seems to be simple and effective path forward so going with the first proposal.

@ZhenjaHorbach 's proposal here #29345 (comment) looks good and works well. Instead of removing spaces, replace the /s with ' ' (space).

🎀 👀 🎀
C+ Reviewed

Copy link

melvin-bot bot commented Oct 31, 2023

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

@Vadym-33
Copy link

hello, @abdulrahuman5196 I think my proposal is correct. please check.

Copy link

melvin-bot bot commented Nov 1, 2023

@amyevans @abdulrahuman5196 @laurenreidexpensify this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

@melvin-bot melvin-bot bot removed 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

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

Offer link
Upwork job

Copy link

melvin-bot bot commented Nov 1, 2023

📣 @ZhenjaHorbach 🎉 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 📖

Copy link

melvin-bot bot commented Nov 1, 2023

📣 @dhanashree-sawant 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@ZhenjaHorbach
Copy link
Contributor

Offer link

PR will be ready today

@Vadym-33
Copy link

Vadym-33 commented Nov 1, 2023

Why I am not on this?

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 1, 2023
@Vadym-33
Copy link

Vadym-33 commented Nov 2, 2023

no correct decision here.

@abdulrahuman5196
Copy link
Contributor

@Vadym-33 The proposal selection reason is already provided here #29345 (comment)

When multiple proposals are similar we choose the first one.

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
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:
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:

Not a regression. Seems to be the case for this particular currency from implementation.

Determine if we should create a regression test for this bug.
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.

No. Not beneficial for this minor bug.

@laurenreidexpensify

Seems melvin didn't udpate here automatically. But seems the issue is due for payment today - #30735 (comment)

@amyevans amyevans changed the title [$500] XOF currency not searchable by its second term [HOLD for payment 2023-11-17][$500] XOF currency not searchable by its second term Nov 17, 2023
@amyevans amyevans added Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review Weekly KSv2 labels Nov 17, 2023
@melvin-bot melvin-bot bot added the Overdue label Nov 20, 2023
@laurenreidexpensify
Copy link
Contributor

Payment Summary:

Bug Reporter - $50 @dhanashree-sawant payment issued in Upwork
Contributor - $500 @ZhenjaHorbach payment issued in Upwork
C+ Review - $500 @abdulrahuman5196 payment issued in Upwork

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

7 participants