Skip to content

[Due for payment 2025-04-28] [$250] Expense - Report field is accessible by receiver in p2p expense and it opens blank page #60238

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

Closed
6 of 8 tasks
mitarachim opened this issue Apr 15, 2025 · 19 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@mitarachim
Copy link

mitarachim commented Apr 15, 2025

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.1.28-1
Reproducible in staging?: Yes
Reproducible in production?: Unable to check
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. [User A] Submit an expense to User B.
  3. [User A] Go to transaction thread.
  4. [User A] Click Report field.
  5. [User A] Note that it opens a blank page.
  6. [User B] Open chat with User A.
  7. [User B] Go to transaction thread.
  8. [User B] Click Report field.
  9. [User B] Note that it opens a blank page.

Expected Result:

Report field should not be accessible for the receiver in p2p expense.

Actual Result:

Report field is accessible for the receiver in p2p expense and it opens blank page.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6802363_1744692214234.20250415_124045.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021912074972490831782
  • Upwork Job ID: 1912074972490831782
  • Last Price Increase: 2025-04-15
Issue OwnerCurrent Issue Owner: @jliexpensify
@mitarachim mitarachim added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 DeployBlocker Indicates it should block deploying the API DeployBlockerCash This issue or pull request should block deployment labels Apr 15, 2025
Copy link

melvin-bot bot commented Apr 15, 2025

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

Copy link

melvin-bot bot commented Apr 15, 2025

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

Copy link

melvin-bot bot commented Apr 15, 2025

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 15, 2025
Copy link
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.

@madmax330 madmax330 added the External Added to denote the issue can be worked on by a contributor label Apr 15, 2025
@melvin-bot melvin-bot bot changed the title Expense - Report field is accessible by receiver in p2p expense and it opens blank page [$250] Expense - Report field is accessible by receiver in p2p expense and it opens blank page Apr 15, 2025
Copy link

melvin-bot bot commented Apr 15, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 15, 2025
Copy link

melvin-bot bot commented Apr 15, 2025

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

@rayane-d
Copy link
Contributor

@daledah
Copy link
Contributor

daledah commented Apr 15, 2025

Proposal

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

  • Report field is accessible for the receiver in p2p expense and it opens blank page.

What is the root cause of that problem?

  • We don't disable this row when we don't have valid report data to display, which can lead to a blank screen.

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


!!getOutstandingReports(policyID, allReports ?? {}).at(0)

shouldShowNotFoundPage={expenseReports.length === 0}

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

  • None

What alternative solutions did you explore? (Optional)

@PiyushChandra17
Copy link

Proposal

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

Expense - Report field is accessible by receiver in p2p expense and it opens blank page

What is the root cause of that problem?

The issue here is that the “Report” field is clickable even for the receiver in a P2P expense, and it leads to a blank page — likely because the report?.reportID is invalid or inaccessible for that user.

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

Only allow valid, authorized users (e.g. the sender) to click on the report field. Otherwise, the UI should either:

  • Not be interactive, or
  • Do nothing on click (or show a tooltip/message).

I think we should apply the following changes here,

{!!parentReportID && (
<OfflineWithFeedback pendingAction={getPendingFieldAction('reportID')}>
<MenuItemWithTopDescription
shouldShowRightIcon
title={parentReport?.reportName}
description={translate('common.report')}
style={[styles.moneyRequestMenuItem]}
titleStyle={styles.flex1}
onPress={() => {
if (!report?.reportID || !transaction?.transactionID) {
return;
}
Navigation.navigate(
ROUTES.MONEY_REQUEST_STEP_REPORT.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID, report.reportID, getReportRHPActiveRoute()),
);
}}
interactive
shouldRenderAsHTML
/>
</OfflineWithFeedback>
)}

  1. Modify shouldShowRightIcon={canViewReport} and interactive={canViewReport}
<OfflineWithFeedback pendingAction={getPendingFieldAction('reportID')}>
                    <MenuItemWithTopDescription
                        shouldShowRightIcon={canViewReport}
                        title={parentReport?.reportName}
                        description={translate('common.report')}
                        style={[styles.moneyRequestMenuItem]}
                        titleStyle={styles.flex1}
                        onPress={() => {
                            if (!canViewReport || !report?.reportID || !transaction?.transactionID) {
                                return;
                            }
                
                            Navigation.navigate(
                                ROUTES.MONEY_REQUEST_STEP_REPORT.getRoute(
                                    CONST.IOU.ACTION.EDIT,
                                    iouType,
                                    transaction.transactionID,
                                    report.reportID,
                                    getReportRHPActiveRoute()
                                )
                            );
                        }}
                        interactive={canViewReport}
                        shouldRenderAsHTML
                    />
                </OfflineWithFeedback>
  1. Add the canViewReport Check

Define canViewReport using the appropriate logic based on:

  • If the user is the sender
  • Or has access to report.reportID
  1. Add this before rendering, This ensures only the sender of the parent report can navigate to the full report screen.
const isCurrentUserSender = parentReport?.ownerAccountID === currentUserAccountID;
const canViewReport = Boolean(parentReportID && isCurrentUserSender && report?.reportID && transaction?.transactionID);

also, add:

const [session, setSession] = useOnyx(ONYXKEYS.SESSION, {});
const currentUserAccountID = session?.accountID;

Here, in MoneyRequestView in order to pull the currentUserAccountID

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

N/A

What alternative solutions did you explore? (Optional)

Absolute NONE

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.

@PiyushChandra17
Copy link

@jliexpensify Since this is a deploy blocker, I can a raise a quick PR. Also update my proposal accordingly if needed. Thank You

@waterim
Copy link
Contributor

waterim commented Apr 15, 2025

Thank you @PiyushChandra17, but it will be fixed in my follow-up PR

@luacmartins
Copy link
Contributor

We'll put this button behind a beta and tackle the issue as a follow up.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 15, 2025
@luacmartins luacmartins added Help Wanted Apply this label when an issue is open to proposals by contributors and removed DeployBlocker Indicates it should block deploying the API labels Apr 15, 2025
@jliexpensify
Copy link
Contributor

Can we move this one to a Daily so we don't get pings? 😅

@luacmartins
Copy link
Contributor

No longer available in staging. Demoting.

@luacmartins luacmartins added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Hourly KSv2 labels Apr 15, 2025
Copy link

melvin-bot bot commented Apr 21, 2025

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

@melvin-bot melvin-bot bot added the Overdue label Apr 21, 2025
@jliexpensify
Copy link
Contributor

Just a heads up that I am OOO until the 30th but will fix up any payments when I'm back.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Overdue labels Apr 21, 2025
@melvin-bot melvin-bot bot changed the title [$250] Expense - Report field is accessible by receiver in p2p expense and it opens blank page [Due for payment 2025-04-28] [$250] Expense - Report field is accessible by receiver in p2p expense and it opens blank page Apr 21, 2025
Copy link

melvin-bot bot commented Apr 21, 2025

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

If no regressions arise, payment will be issued on 2025-04-28. 🎊

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

  • @eVoloshchak requires payment through NewDot Manual Requests
  • @waterim does not require payment (Contractor)

Copy link

melvin-bot bot commented Apr 21, 2025

@eVoloshchak @jliexpensify @eVoloshchak The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@luacmartins
Copy link
Contributor

luacmartins commented Apr 22, 2025

We can close this one since it's been fixed by #60318 and payment will be handled in #60288

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. Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants