Skip to content

[HOLD for payment 2022-12-20] [HOLD for payment 2022-12-15] Request money - The list of currency is empty until you enter any letter in search field #13286

Closed

Description

@kavimuru

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to URL https://staging.new.expensify.com/
  2. Login with any account
  3. Click on FAB button -> Request money
  4. Click on the currency icon

Expected Result:

The currency list must be filled with a list of currencies

Actual Result:

The list of currency is empty until you enter any letter in search field

Workaround:

unknown

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: 1.2.36-0
Reproducible in staging?: y
Reproducible in production?: n
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:

Bug5845727_Recording__3165.mp4

Expensify/Expensify Issue URL:
Issue reported by: Applause internal team
Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cfd75a5dd3d584dd
  • Upwork Job ID: 1606450618598191104
  • Last Price Increase: 2022-12-24

Activity

  1. OSBotify commented on Dec 2, 2022

    @OSBotify
    Contributor

    👋 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.
  2. melvin-bot commented on Dec 2, 2022

    @melvin-bot

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

  3. 0xmiroslav commented on Dec 2, 2022

    @0xmiroslav
    Contributor

    This is a regression from #13186 which fixes #12026

  4. s77rt commented on Dec 2, 2022

    @s77rt
    Member

    Proposal

    diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js
    index bc9a4facd5..62fda478db 100644
    --- a/src/libs/OptionsListUtils.js
    +++ b/src/libs/OptionsListUtils.js
    @@ -787,6 +787,10 @@ function getHeaderMessage(hasSelectableOptions, hasUserToInvite, searchValue, ma
      * @returns {Array}
      */
     function getCurrencyListForSections(currencyOptions, searchValue) {
    +    if (!searchValue) {
    +        return {currencyOptions};
    +    }
    +
         const filteredOptions = _.filter(currencyOptions, currencyOption => (
             isSearchStringMatch(searchValue, currencyOption.text)));

    Details

    If the searchValue is empty return all the currency options

    @0xmiroslav I don't think this is a regression, it's more like a hidden bug that has been revealed. If the search value is empty we should return nothing instead of everything unless explicitly specified. Also this will avoid the unnecessary _filter call and squeeze more performance.

  5. tgolen commented on Dec 2, 2022

    @tgolen
    Contributor

    The proposal looks good to me 👍 I'm a bit conflicted on it being a regression or not.

    I think it's technically a regression if it worked properly before and now it doesn't. I think this is just the nature of some regressions and it's why we have the checklist item:

    I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)

    Since isSearchStringMatch was modified, then all the references to it should have been tested and this issue could have been caught.

  6. tgolen commented on Dec 2, 2022

    @tgolen
    Contributor

    cc @cead22 for your thoughts on it since you reviewed the original PR

  7. 0xmiroslav commented on Dec 2, 2022

    @0xmiroslav
    Contributor

    This happens on staging, not on production
    That's why @kavimuru marked this as deploy blocker
    @s77rt you can test yourself by reverting code changes in #13186

  8. s77rt commented on Dec 2, 2022

    @s77rt
    Member

    @0xmiroslav Yes I did, I agree with you, I'm just saying that we have found a hidden bug and posted a solution above.

  9. situchan commented on Dec 2, 2022

    @situchan
    Contributor

    Proposal:

    https://github.com/Expensify/App/blob/main/src/libs/OptionsListUtils.js#L391-L401

    function isSearchStringMatch(searchValue, searchText, participantNames = new Set(), isChatRoom = false) {
    +   if (!searchValue.trim()) {
    +        return true;
    +   }
        const searchWords = _.compact(uniqFast([
            searchValue,
            ..._.map(searchValue.replace(/,/g, ' ').split(' '), word => word.trim()),
        ]));
        const valueToSearch = searchText && searchText.replace(new RegExp(/ /g), '');
        return _.some(searchWords, (word) => {
            const matchRegex = new RegExp(Str.escapeForRegExp(word), 'i');
            return matchRegex.test(valueToSearch) || (!isChatRoom && participantNames.has(word));
        });
    }

    This allows no filter with endless blank text like all other popular search engines do

    Or if it should be filtered by blank space, just this condition would be fine:
    if (!searchValue)

  10. 49 remaining items

  11. changed the title [-][HOLD for payment 2022-12-15] Request money - The list of currency is empty until you enter any letter in search field[/-] [+][HOLD for payment 2022-12-20] [HOLD for payment 2022-12-15] Request money - The list of currency is empty until you enter any letter in search field[/+] on Dec 13, 2022
  12. melvin-bot commented on Dec 21, 2022

    @melvin-bot

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

  13. melvin-bot commented on Dec 23, 2022

    @melvin-bot

    @tgolen Huh... This is 4 days overdue. Who can take care of this?

  14. added
    InternalRequires API changes or must be handled by Expensify staff
    on Dec 24, 2022
  15. melvin-bot commented on Dec 24, 2022

    @melvin-bot
  16. melvin-bot commented on Dec 24, 2022

    @melvin-bot

    Current assignee @aimane-chnaif is eligible for the Internal assigner, not assigning anyone new.

  17. mallenexpensify commented on Dec 24, 2022

    @mallenexpensify
    Contributor

    @aimane-chnaif can you please accept the job and reply here once you have?
    https://www.upwork.com/jobs/~01cfd75a5dd3d584dd

  18. aimane-chnaif commented on Dec 24, 2022

    @aimane-chnaif
    Contributor

    @mallenexpensify I didn't fill checklist because PR was merged quickly as it fixes deploy blocker and labeled CP Staging, though I started reviewing.
    So I think I am not eligible for full compensation.
    But I see you already hired me on UP so instead can we use this job to compensate this issue (BZ missing here)?

  19. aimane-chnaif commented on Dec 26, 2022

    @aimane-chnaif
    Contributor

    @aimane-chnaif can you please accept the job and reply here once you have? https://www.upwork.com/jobs/~01cfd75a5dd3d584dd

    @mallenexpensify I accepted your offer for #12235 so you can cancel this job since I am not eligible

  20. mallenexpensify commented on Dec 27, 2022

    @mallenexpensify
    Contributor

    OK, I think this can be closed then. I'm leaving the duplicate 'hold for payment' notifications in the title so we can see why it's happening, I'll create a GH if a fix is needed. Discussing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2EngineeringInternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions