Skip to content

[HOLD for payment 2023-11-17][$500] XOF currency not searchable by its second term #29345

Closed

Description

@kbecciv

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: 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

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 11, 2023
  2. changed the title [-]XOF currency not searchable by its second term[/-] [+][$500] XOF currency not searchable by its second term[/+] on Oct 11, 2023
  3. melvin-bot commented on Oct 11, 2023

    @melvin-bot

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

  4. melvin-bot commented on Oct 11, 2023

    @melvin-bot
  5. melvin-bot commented on Oct 11, 2023

    @melvin-bot

    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
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 11, 2023
  7. melvin-bot commented on Oct 11, 2023

    @melvin-bot

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

  8. ZhenjaHorbach commented on Oct 11, 2023

    @ZhenjaHorbach
    Contributor

    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

  9. yh-0218 commented on Oct 11, 2023

    @yh-0218
    Contributor

    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)

  10. Vadym-33 commented on Oct 11, 2023

    @Vadym-33

    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)

  11. laurenreidexpensify commented on Oct 13, 2023

    @laurenreidexpensify
    Contributor

    @abdulrahuman5196 a few proposals to consider here ^^

  12. 41 remaining items

  13. added
    ReviewingHas a PR in review
    and removed on Nov 1, 2023
  14. Vadym-33 commented on Nov 2, 2023

    @Vadym-33

    no correct decision here.

  15. abdulrahuman5196 commented on Nov 3, 2023

    @abdulrahuman5196
    Contributor

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

    When multiple proposals are similar we choose the first one.

  16. abdulrahuman5196 commented on Nov 17, 2023

    @abdulrahuman5196
    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)

  17. 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[/+] on Nov 17, 2023
  18. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Nov 17, 2023
  19. laurenreidexpensify commented on Nov 20, 2023

    @laurenreidexpensify
    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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions