Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.47k stars 2.82k forks source link

[HOLD for payment 2024-10-16] Search - Selected expense does not remain selected, gets auto deselected #50286

Open IuliiaHerets opened 1 week ago

IuliiaHerets commented 1 week ago

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: v9.0.45-2 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5050173 Issue reported by: Applause Internal Team

Action Performed:

Preconditions: Existing user with existing IOUs/Expenses

  1. Open New Expensify app
  2. Log in as user from preconditions
  3. Tap on Search in the bottom
  4. Tap and hold an Expense
  5. Tap on Select

Expected Result:

Selected expense should be selected (it should be highlighted and it's checkbox should be checked)

Actual Result:

Expense is only briefly selected and then gets auto deselected.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/94104806-89e0-4c14-9aae-d586529735d7

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @abekkala
melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

Triggered auto assignment to @abekkala (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.

github-actions[bot] commented 1 week ago

:wave: 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.
IuliiaHerets commented 1 week ago

We think that this bug might be related to #wave-control

jaydamani commented 1 week ago

Proposal

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

Selected expense does not remain selected, gets auto deselected on narrow screens

What is the root cause of that problem?

This is caused by https://github.com/Expensify/App/pull/49829

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

Revert https://github.com/Expensify/App/pull/49829

cretadn22 commented 1 week ago

Checking

jaydamani commented 1 week ago

@cretadn22 getSections is used to get data and it has 3 flows so it can return array of ReportActionListItemType or TransactionListItemType or ReportListItemType but your looping only handles case of ReportActionListItemType by checking the transactions field. You need to add below code here to handle TransactionListItemType as well. I think you can ignore ReportActionListItemType because it is only for chat search.

            if ('transactionID' in report) {
                if (!Object.keys(selectedTransactions).includes(report.transactionID)) {
                    return;
                }
                newTransactionList[report.transactionID] = {
                    action: report.action,
                    canHold: report.canHold,
                    canUnhold: report.canUnhold,
                    isSelected: selectedTransactions[report.transactionID].isSelected,
                    canDelete: report.canDelete,
                };
            }

Note: I have not completed my investigation but this change seems to work for now so please verify these details. Hopefully, this saves you some time.

thienlnam commented 1 week ago

Here's the new PR that should fix this blocker.

thienlnam commented 1 week ago

Just need payment for C+ review here for @ishpaul777

melvin-bot[bot] commented 1 week ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 1 week ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.45-4 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-10-14. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 1 week ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

abekkala commented 6 days ago

PAYMENT SUMMARY FOR OCT 16

thienlnam commented 6 days ago

This was a regression, so only a payment for @ishpaul777 since it was a different C+ that reviewed this fix

melvin-bot[bot] commented 5 days ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.46-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-10-16. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 5 days ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

abekkala commented 3 days ago

cc: @OfstadC

PAYMENT SUMMARY FOR OCT 16