Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.3.50-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: https://test-management.browserstack.com/projects/2219752/test-runs/TR-13882/folder/13176922/44231135/1285943859?sort=-identifier
Email or phone of affected tester (no customers): snodijosdnjoijiosnj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Mac 26.2 / Chrome
App Component: Search
Action Performed:
- Go to staging.new.expensify.com
- Go to Reports > Expenses.
- Click Filters.
- Scroll down and click Withdrawn.
- Click On.
- Select a date, then click Save.
Expected Result:
The selected date will appear as subtitle below On title.
Actual Result:
The selected date does not appear as subtitle below On title. The date is not selected.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
Screenshots/Videos
Bug7114933_1774618508861.8.mp4
Issue Owner
Current Issue Owner: @cretadn22Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022037529473436881136
- Upwork Job ID: 2037529473436881136
- Last Price Increase: 2026-03-27
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
MelvinBot commentedon Mar 27, 2026
Proposal
What is the root cause of that problem?
When a user selects a date modifier (On/After/Before) in any date-based search filter,
Navigation.navigatepushes a new screen instance onto the stack. This happens becauselinkTo(App/src/libs/Navigation/helpers/linkTo/index.ts:156-164) converts NAVIGATE to PUSH for these sub-page routes (they don't match any registered dynamic route suffix).The user picks a date on the calendar and clicks Save.
DateFilterBase.save()(App/src/components/Search/FilterComponents/DateFilterBase.tsx:140-154) stores the date only in the pushed instance's local React state viasetDateValueOfSelectedDateModifier(), then immediately navigates back — popping and destroying that instance. The original instance is revealed with its own independent state that never received the selected date. Crucially,onSubmit(which writes to Onyx) is intentionally skipped whenselectedDateModifieris set, so the value is never persisted anywhere.This affects all date filters using
SearchDatePresetFilterBasePage(date, submitted, approved, paid, exported, posted, withdrawn), not just Withdrawn.What changes do you think we should make in order to solve the problem?
Two changes are needed:
In
SearchDatePresetFilterBasePage(App/src/components/Search/SearchDatePresetFilterBasePage.tsx): PassonDateValuesChangetoDateFilterBasethat writes intermediate date values to Onyx viaupdateAdvancedFilters. The existingonDateValueChangecallback inDatePresetFilterBaseis already called synchronously insidesetDateValue(whichsetDateValueOfSelectedDateModifiertriggers), so the Onyx write will happen before the navigation/pop occurs.In
DatePresetFilterBase(App/src/components/Search/FilterComponents/DatePresetFilterBase.tsx:83-89): Update theuseEffectto also syncdateValuesstate whendefaultDateValueschanges (currently it only watchesisSearchAdvancedFiltersFormLoading). This allows the original instance to pick up the Onyx values written by the pushed instance before it was popped. The individual date value strings (On/Before/After) should be used as dependencies rather than the object reference.What alternative solutions did you explore? (Optional)
DYNAMIC_ROUTES: This would makefindMatchingDynamicSuffixreturn a match, keeping the action as NAVIGATE (params update in place). However, this would change the navigation pattern for all date filters and might have unintended side effects with browser history.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.melvin-bot commentedon Mar 27, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cretadn22 (
External)[-]Reports - Unable to select date filter[/-][+][$250] Reports - Unable to select date filter[/+]melvin-bot commentedon Mar 27, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022037529473436881136
trasnake87 commentedon Mar 27, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When selecting a date modifier (On/After/Before) in any date-based search filter and picking a date from the calendar, the date is not persisted — it silently disappears after clicking Save.
What is the root cause of that problem?
In
SearchDatePresetFilterBasePage, theselectDateModifiercallback usesNavigation.navigate(buildSubPageRoute(...))to switch between the modifier list and the calendar view. BecauselinkToconverts this NAVIGATE action into a PUSH, a new screen instance is mounted with its own freshDatePresetFilterBasestate. When the user picks a date and clicks Save,DateFilterBase.save()writes the date into that new instance's local state viasetDateValueOfSelectedDateModifier(), then immediately callssetSelectedDateModifier(null)— which triggersNavigation.goBack(), popping and destroying the instance along with its state. The original instance underneath never received the date.What changes do you think we should make in order to solve the problem?
Replace
Navigation.navigate/Navigation.goBackinselectDateModifierwithnavigation.setParamsso that toggling thesubPageparam updates the existing screen in-place instead of pushing a new one. This keeps a single component instance alive, preserving theDatePresetFilterBaselocal state across list ↔ calendar transitions. The header back button already works correctly viaDateFilterBase.goBack().In
src/components/Search/SearchDatePresetFilterBasePage.tsx:This is a single-file fix. It avoids persisting intermediate/unsaved values to Onyx, keeps the component lifecycle simple, and the
buildSubPageRoutehelper +Navigationimport for this callback become unused and can be removed.What alternative solutions did you explore?
Persisting intermediate date values to Onyx via
onDateValuesChangeon every calendar interaction was considered, but that writes draft state to the store before the user has committed —setParamsis simpler and avoids side effects.trasnake87 commentedon Mar 27, 2026
Contributor details
Your Expensify account email: trasnake87@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~010f770315ab181656
melvin-bot commentedon Mar 27, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
MobileMage commentedon Mar 27, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
github-actions commentedon Mar 27, 2026
20 remaining items
github-actions commentedon Mar 30, 2026
marufsharifi commentedon Mar 30, 2026
@cretadn22 I’ve submitted the proposal—could you please take a look? Thanks.
marufsharifi commentedon Mar 31, 2026
@cretadn22 gentle bump. thanks.
cretadn22 commentedon Mar 31, 2026
@marufsharifi Your proposal is working great. Please create a PR to address this regression. Because Joel is OOO so I will review the PR as confirmed in this thread
cretadn22 commentedon Apr 2, 2026
This feature was recently updated, and the bug is no longer reproducible
Screen.Recording.2026-04-02.at.23.36.39.mov
cretadn22 commentedon Apr 3, 2026
@mallenexpensify As noted in above comment, the bug is no longer reproducible on main. However, since I had already started, I’ve completed the proposal review and the PR review, including the full checklist and testing across all platforms. Could you please post the payment for me?
cretadn22 commentedon Apr 3, 2026
Another note, this is regression from #83154, I’ve stepped in to finish the review and testing since Joel is OOO(confirmed in Slack)
mallenexpensify commentedon Apr 6, 2026
Payment Summary
Contributor+: @cretadn22 due $250 via NewDot
(bit tricky but they took over to help and the PR was reviewed with tests completed so payout should be 100%)
JmillsExpensify commentedon Apr 15, 2026
$250 approved for @cretadn22
cretadn22 commentedon Apr 26, 2026
@wubing-wx I’m sorry, is there a misunderstanding? I don't know who you are?