Skip to content

[Due for payment 2025-07-18] [$250] Fix isOneTransactionReport #64333

@grgia

Description

@grgia

Problem

/**
 * Checks if a report has only one transaction associated with it
 */
function isOneTransactionReport(report: OnyxEntry<Report>): boolean {
    const reportActions = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report?.reportID}`] ?? ([] as ReportAction[]);
    const chatReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report?.chatReportID}`];
    return getOneTransactionThreadReportID(report, chatReport, reportActions) !== null;
}

getOneTransactionThreadReportID never returns null, it returns undefined. Therefore, this function ALWAYS RETURNS TRUE.

However, There's a load of icon/search logic using this function incorrectly. I can't just update the line without breaking things

Solution

    return getOneTransactionThreadReportID(report, chatReport, reportActions) !== undefined;

Ensure there are no regressions from this change

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021935157794186843039
  • Upwork Job ID: 1935157794186843039
  • Last Price Increase: 2025-06-18
Issue OwnerCurrent Issue Owner: @stephanieelliott

Metadata

Metadata

Labels

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions