fix: Start & End date does not matches Title format with Trip-based Auto-reporting#87140
fix: Start & End date does not matches Title format with Trip-based Auto-reporting#87140TaduJR wants to merge 4 commits intoExpensify:mainfrom
Conversation
|
@mananjadhav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c1e82da8f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
JmillsExpensify
left a comment
There was a problem hiding this comment.
Fix looks good to product
…uto-reporting-frequency # Conflicts: # src/libs/actions/IOU/index.ts
Explanation of Change
TRIP end date used
currentDateinstead of newest transaction (Formula.ts) —getAutoReportingDatesnow callsgetNewestTransactionDate()for the TRIP end date so it reflects the actual last expense date, not today's date.Optimistic transactions invisible to date helpers (
Formula.ts) —getAllReportTransactionsWithContextnow mergescontext.allTransactions(passed bycomputeOptimisticReportName). Previously it only handledcontext.transaction(singular), so transactions not yet in Onyx were invisible during optimistic updates. Also wiredcontextthroughcomputeAutoReportingInfo→getAutoReportingDates→ date helpers.Wrong formula engine and blocked guard for existing reports (
IOU/index.ts) —maybeUpdateReportNameForFormulaTitlenow usescomputeOptimisticReportName(full Formula engine that supports{report:autoreporting:*}) instead ofpopulateOptimisticReportFormula(regex replacer that strips them). The guard now falls back topolicy.fieldListwhenreportNameValuePairsdoesn't exist yet (optimistic reports). The call is moved after STEP 3 so the optimistic transaction is available for formula computation.Fixed Issues
$ #74268
PROPOSAL:
Tests
Preconditions:
SSetNameValuePair('useCustomReportNamesNewExpensify', 'true')Trip from {report:autoreporting:start:MMM dd} to {report:autoreporting:end:MMM dd, yyyy}Online:
Trip from Jan 01 to Jan 15, 2025(matching actual transaction dates)Offline (optimistic):
4. Go offline (toggle airplane mode or disconnect network)
5. Open an existing report that already has an expense dated Jan 1
6. Create a new expense with date Jan 20
7. Verify the report title immediately updates to
Trip from Jan 01 to Jan 20, 2025(not today's date)New report offline:
8. While still offline, create a new expense in a new report with date Feb 10
9. Verify the report title shows
Trip from Feb 10 to Feb 10, 2025Scan expense regression check (#86839):
{report:startdate}while SmartScan is processingOffline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android-Native.mp4
Android: mWeb Chrome
Android-mWeb.mp4
iOS: Native
iOS-Native.mp4
iOS: mWeb Safari
iOS-Safari.mp4
MacOS: Chrome / Safari
output.mp4
MacOS: Desktop
Mac-Desktop-3.mp4