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 Owner
Current Issue Owner: @stephanieelliott
Problem
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
Ensure there are no regressions from this change
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @stephanieelliott