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

[$125] Android - Track expense - On deleting track expense, user navigated to expense details page briefly #54058

Open
2 of 8 tasks
lanitochka17 opened this issue Dec 12, 2024 · 26 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Dec 12, 2024

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: 9. 0.75-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Component Money Requests

Action Performed:

  1. Launch app
  2. Open self dm
  3. Create a track expense
  4. Tap on header - delete expense

Expected Result:

On deleting track expense, user must be navigated to self dm

Actual Result:

On deleting track expense, user navigated to expense details page briefly

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6692569_1734029043668.Screenrecorder-2024-12-13-00-08-20-649.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021869209129305046876
  • Upwork Job ID: 1869209129305046876
  • Last Price Increase: 2025-01-01
  • Automatic offers:
    • daledah | Contributor | 105602230
Issue OwnerCurrent Issue Owner: @daledah
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Dec 16, 2024
Copy link

melvin-bot bot commented Dec 16, 2024

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

@twisterdotcom
Copy link
Contributor

@melvin-bot melvin-bot bot removed the Overdue label Dec 18, 2024
@twisterdotcom twisterdotcom added the External Added to denote the issue can be worked on by a contributor label Dec 18, 2024
@melvin-bot melvin-bot bot changed the title Android - Track expense - On deleting track expense, user navigated to expense details page briefly [$250] Android - Track expense - On deleting track expense, user navigated to expense details page briefly Dec 18, 2024
Copy link

melvin-bot bot commented Dec 18, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 18, 2024
Copy link

melvin-bot bot commented Dec 18, 2024

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

@twisterdotcom
Copy link
Contributor

125 because track isn't a priority right now.

@twisterdotcom twisterdotcom changed the title [$250] Android - Track expense - On deleting track expense, user navigated to expense details page briefly [$125] Android - Track expense - On deleting track expense, user navigated to expense details page briefly Dec 18, 2024
Copy link

melvin-bot bot commented Dec 18, 2024

Upwork job price has been updated to $125

@daledah
Copy link
Contributor

daledah commented Dec 20, 2024

Edited by proposal-police: This proposal was edited at 2024-12-23 09:08:20 UTC.

Proposal

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

On deleting track expense, user navigated to expense details page briefly

What is the root cause of that problem?

In here:

App/src/libs/ReportUtils.ts

Lines 4255 to 4270 in 207622d

function navigateBackOnDeleteTransaction(backRoute: Route | undefined, isFromRHP?: boolean) {
if (!backRoute) {
return;
}
const topmostCentralPaneRoute = Navigation.getTopMostCentralPaneRouteFromRootState();
if (topmostCentralPaneRoute?.name === SCREENS.SEARCH.CENTRAL_PANE) {
Navigation.dismissModal();
return;
}
if (isFromRHP) {
Navigation.dismissModal();
}
Navigation.isNavigationReady().then(() => {
Navigation.goBack(backRoute);
});
}

When deleting track expense, dismissModal is called first, causing the screen to go back to transaction report page, before goBack is called and we're navigated back to self DM report.

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

We can use a logic added in this PR to fix this issue.

Add a param reportID to navigateBackOnDeleteTransaction, and pass it here:

ReportUtils.navigateBackOnDeleteTransaction(urlToNavigateBack as Route, true);

ReportUtils.navigateBackOnDeleteTransaction(urlToNavigateBack as Route, true, report.reportID);

Then update the following logic:

App/src/libs/ReportUtils.ts

Lines 4264 to 4266 in 207622d

if (isFromRHP) {
Navigation.dismissModal();
}

    if (isFromRHP) {
        if (reportID) {
            const trackReport = Navigation.getPreviousTrackReport(reportID);
            if (trackReport?.key) {
                Navigation.removeScreenByKey(trackReport.key);
            }
        }
        Navigation.isNavigationReady().then(() => Navigation.dismissModal());
    }

Because we only delete the transaction after navigating back, ReportScreen will display the most recently report action, which is the whisper message. To hide this, we need to update shouldShowMostRecentReportAction here:

const shouldShowMostRecentReportAction =
!!mostRecentReportAction &&
!isSingleExpenseReport &&
!isSingleInvoiceReport &&
!ReportActionsUtils.isActionOfType(mostRecentReportAction, CONST.REPORT.ACTIONS.TYPE.CREATED) &&
!ReportActionsUtils.isDeletedAction(mostRecentReportAction);

To return false if there’s a transaction being deleted:

const shouldShowMostRecentReportAction =
        !!mostRecentReportAction &&
        !isSingleExpenseReport &&
        !isSingleInvoiceReport &&
        !ReportActionsUtils.isActionOfType(mostRecentReportAction, CONST.REPORT.ACTIONS.TYPE.CREATED) &&
        !ReportActionsUtils.isDeletedAction(mostRecentReportAction) &&
        (!deleteTransactionNavigateBackUrl || !ReportActionsUtils.isActionOfType(mostRecentReportAction, CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_TRACK_EXPENSE_WHISPER));

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

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.

@melvin-bot melvin-bot bot added the Overdue label Dec 20, 2024
@dukenv0307
Copy link
Contributor

@daledah Bug after applying your solution, the whisper message show briefly

Screen.Recording.2024-12-21.at.22.51.25.mov

On prod, it just shows the loading screen briefly.

@melvin-bot melvin-bot bot removed the Overdue label Dec 21, 2024
@daledah
Copy link
Contributor

daledah commented Dec 23, 2024

@dukenv0307 i updated proposal

@dukenv0307
Copy link
Contributor

@daledah After deleting the track expense in chat page, the whisper message is hidden along with the expense. Can you apply the same on this case?

Screen.Recording.2024-12-24.at.15.15.38.mov

Copy link

melvin-bot bot commented Dec 25, 2024

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

Copy link

melvin-bot bot commented Dec 26, 2024

@twisterdotcom @dukenv0307 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Dec 26, 2024
@daledah
Copy link
Contributor

daledah commented Dec 26, 2024

@dukenv0307 The logics are correct. It’s the onyx data condition that causes the whisper to show.
See the image below:
image
In the case of delete via context menu, optimistic data is merge immediately, so the whisper is not shown

@dukenv0307
Copy link
Contributor

@daledah's proposal LGTM

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Dec 26, 2024

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

Copy link

melvin-bot bot commented Dec 30, 2024

@puneetlath, @twisterdotcom, @dukenv0307 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Dec 30, 2024
Copy link

melvin-bot bot commented Jan 1, 2025

@puneetlath, @twisterdotcom, @dukenv0307 Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Jan 1, 2025

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

Copy link

melvin-bot bot commented Jan 3, 2025

@puneetlath, @twisterdotcom, @dukenv0307 Still overdue 6 days?! Let's take care of this!

@twisterdotcom
Copy link
Contributor

We're just waiting for @puneetlath right?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jan 3, 2025
@dukenv0307
Copy link
Contributor

Yes @twisterdotcom

Copy link

melvin-bot bot commented Jan 7, 2025

@puneetlath, @twisterdotcom, @dukenv0307 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Jan 7, 2025
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 7, 2025
Copy link

melvin-bot bot commented Jan 7, 2025

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

@melvin-bot melvin-bot bot removed the Overdue label Jan 7, 2025
Copy link

melvin-bot bot commented Jan 9, 2025

@puneetlath @twisterdotcom @dukenv0307 @daledah this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@twisterdotcom
Copy link
Contributor

@daledah assigned yesterday.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

5 participants