You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reports-Report Title is not changed when change expense date if offline #73099
Version Number: v9.2.35-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#70627 Email or phone of affected tester (no customers):applausetester+ndk59@applause.expensifail.com Issue reported by: Applause Internal Team Device used: Windows 11 Home/Chrome App Component: Money Requests
Action Performed:
Precondition: Use Expensifail account and add it to the beta.
Please re-state the problem that we are trying to solve in this issue.
Report titles using {report:enddate} formula don't update when expense dates are changed while offline.
What is the root cause of that problem?
The Formula.ts file lacks support for the {report:enddate} placeholder here
While {report:startdate} (oldest transaction date) is implemented, the corresponding {report:enddate} (newest transaction date) case is missing
When expenses are added/modified offline, the optimistic report name computation skips the {report:enddate} placeholder, leaving it unchanged
What changes do you think we should make in order to solve the problem?
In Formulas:
Add a getNewestTransactionDate function that returns the newest transaction date:
functiongetNewestTransactionDate(reportID: string,context?: FormulaContext): string|undefined{if(!reportID){returnundefined;}const transactions =getReportTransactions(reportID);if(!transactions||transactions.length===0){returnnewDate().toISOString();}letnewestDate: string|undefined;transactions.forEach((transaction)=>{// Use updated transaction data if available and matches this transactionconstcurrentTransaction=context?.transaction&&transaction.transactionID===context.transaction.transactionID ? context.transaction : transaction;constcreated=getCreated(currentTransaction);if(!created){return;}if(newestDate&&created<=newestDate){return;}if(isPartialTransaction(currentTransaction)){return;}newestDate=created;});returnnewestDate;}
optional instead of duplicating code of the getOldestTransactionDate and the new introduced function, we can add a shared function that takes getOldest: boolean param if true then it gets the oldest otherwise it gets the newest.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
In FormulaTest:
Add test cases for {report:enddate} computation with default format
Add test cases for {report:enddate} with custom date formats
Add test case for formulas using both {report:startdate} and {report:enddate} together
test('should compute enddate formula using transactions',()=>{constresult=compute('{report:enddate}',mockContext);expect(result).toBe('2025-01-14');// use newest transaction date (2025-01-14)});test('should compute enddate with custom format',()=>{constresult=compute('{report:enddate:MM/dd/yyyy}',mockContext);expect(result).toBe('01/14/2025');// use newest transaction date with MM/dd/yyyy format});test('should compute enddate with short month format',()=>{constresult=compute('{report:enddate:dd MMM yyyy}',mockContext);expect(result).toBe('14 Jan 2025');// use newest transaction date with dd MMM yyyy format});test('should compute formula with both startdate and enddate',()=>{constresult=compute('Started {report:startdate} vs Ended {report:enddate}',mockContext);expect(result).toBe('Started 2025-01-08 vs Ended 2025-01-14');});
What alternative solutions did you explore? (Optional)
I think the beta flag is not enabled on the account. newExpensifyCustomReportNames is an explicitOnly flag, so it must be specifically enabled. Precondition Documentation.
Activity
melvin-bot commentedon Oct 21, 2025
Triggered auto assignment to @isabelastisser (
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.abzokhattab commentedon Oct 21, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Report titles using
{report:enddate}formula don't update when expense dates are changed while offline.What is the root cause of that problem?
Formula.tsfile lacks support for the{report:enddate}placeholder here{report:startdate}(oldest transaction date) is implemented, the corresponding{report:enddate}(newest transaction date) case is missing{report:enddate}placeholder, leaving it unchangedWhat changes do you think we should make in order to solve the problem?
In Formulas:
getNewestTransactionDatefunction that returns the newest transaction date:enddatecase in thecomputeReportPartfunction's switch statement:optional instead of duplicating code of the
getOldestTransactionDateand the new introduced function, we can add a shared function that takesgetOldest: booleanparam if true then it gets the oldest otherwise it gets the newest.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
In
FormulaTest:{report:enddate}computation with default format{report:enddate}with custom date formats{report:startdate}and{report:enddate}togetherWhat alternative solutions did you explore? (Optional)
NA
mohammadjafarinejad commentedon Oct 21, 2025
I think the beta flag is not enabled on the account.
newExpensifyCustomReportNamesis anexplicitOnlyflag, so it must be specifically enabled. Precondition Documentation.isabelastisser commentedon Oct 27, 2025
I think this behavior is expected, given this precondition. Closing.