Repository navigation
fix: result only shows up after reapplying group-by:approver - #106172
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08ef51c66e
ℹ️ 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".
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2026-11-06.at.17.32.29.mov |
twisterdotcom
left a comment
There was a problem hiding this comment.
Looks good from a product perspective.
neil-marcellini
left a comment
There was a problem hiding this comment.
(Neil's AI agent, human reviewed)
Requesting changes so this PR also handles has:submitted-violation (see the inline comment). It's the same problem as approved violations, so fixing both here is simpler than a second PR.
|
@neil-marcellini I updated. |
neil-marcellini
left a comment
There was a problem hiding this comment.
(Neil's AI agent, human reviewed)
Thanks for the updates! Requesting changes for two things:
-
Please include the
approver:andanyApproval:filters inshouldRefetchSearchOnReportActionChange, as I asked earlier. Details in the inline comment. -
Please add quick manual tests for every filter this PR fixes. For each one, submit or approve from the workspace chat, go back to Spend, and verify the results update without re-running the search:
group-by:approverhas:submitted-violationand-has:submitted-violationhas:approved-violationand-has:approved-violationapprover:anyApproval:submitted:/approved:, if you include them
Please also add an offline step (approve while offline, reconnect, the results update) and a short web video covering these. The current videos predate the
has:submitted-violationchange.
|
@neil-marcellini I updated. |
neil-marcellini
left a comment
There was a problem hiding this comment.
Good to go, thank you. I spotted some opportunities to clean up the code a little bit, and they're pretty straightforward. If you could please raise a follow-up PR to do that, it would be great, but it's not a blocker for merging this.
| if (previousActions?.[reportActionID]) { | ||
| continue; | ||
| } | ||
| if (isSubmittedAction(reportAction) || isSubmittedAndClosedAction(reportAction) || isApprovedAction(reportAction) || isForwardedAction(reportAction)) { |
There was a problem hiding this comment.
(Neil's AI agent, human reviewed)
NAB: Hold.ts already keeps a list of workflow action types that matches the backend's WORKFLOW_ACTIONS. Could we move it into CONST (e.g. CONST.REPORT.WORKFLOW_ACTIONS) and use it here instead of the four is*Action checks?
That also catches approver changes. Changing the approver adds a TAKE_CONTROL or REROUTE action and changes the report's approver without changing a transaction. For example, an admin moves a report from Alice to Bob while viewing group-by:approver, and the report stays under Alice until the search is re-run.
It does bring back UNAPPROVED and a few other rare actions I suggested dropping earlier, but one list shared with the backend is worth a few extra refetches.
| return ( | ||
| queryJSON.groupBy === CONST.SEARCH.GROUP_BY.APPROVER || | ||
| queryJSON.flatFilters.some((filter) => WORKFLOW_FILTER_KEYS.has(filter.key)) || | ||
| queryHasHasFilter(queryJSON, [CONST.SEARCH.HAS_VALUES.SUBMITTED_VIOLATION, CONST.SEARCH.HAS_VALUES.APPROVED_VIOLATION], true) |
There was a problem hiding this comment.
(Neil's AI agent, human reviewed)
NAB: [SUBMITTED_VIOLATION, APPROVED_VIOLATION] now appears three times in this file (queryHasViolationFilter, here, and hasValuesIncludeViolationFilter). Could we pull it into a constant next to WORKFLOW_FILTER_KEYS, like VIOLATION_HAS_VALUES, and use it in all three?
| // When a report is approved | ||
| rerender(withAddedAction(ungroupedProps, 'APPROVED')); | ||
|
|
||
| // Then no search is triggered, because only the approver grouping depends on approval actions |
There was a problem hiding this comment.
(Neil's AI agent, human reviewed)
NAB: since the approver:, anyApproval:, submitted:, approved: and violation filters were added, "only the approver grouping depends on approval actions" isn't accurate anymore. Could we rename the test to something like should not trigger search when an approval report action is added and the query doesn't depend on workflow state, and update this comment to match?
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 neil-marcellini has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.5.38-0 🚀
|
|
No help site update needed — this PR fixes stale search results after report workflow actions, restoring expected behavior without adding a feature or making existing article instructions incorrect. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.39-2 🚀
|
Explanation of Change
fix: result only shows up after reapplying group-by:approver
Fixed Issues
$ #105557
PROPOSAL: #105557 (comment)
Tests
group-by:approverhas:submitted-violation,-has:submitted-violation,has:approved-violation,-has:approved-violation,approver:,anyApproval:,submitted: / approved:Offline tests
QA Steps
Same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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
Screen.Recording.2026-11-06.at.11.56.59.mov
Android: mWeb Chrome
Screen.Recording.2026-11-06.at.11.53.09.mov
iOS: Native
Screen.Recording.2026-11-06.at.11.54.40.mov
iOS: mWeb Safari
Screen.Recording.2026-11-06.at.11.50.35.mov
MacOS: Chrome / Safari
Screen.Recording.2026-11-06.at.11.27.26.mov
Screen.Recording.2026-11-11.at.15.43.25.mov
Screen.Recording.2026-11-11.at.15.45.55.mov
Screen.Recording.2026-11-11.at.15.46.52.mov
Screen.Recording.2026-11-11.at.15.47.40.mov
Screen.Recording.2026-11-11.at.15.48.15.mov
Screen.Recording.2026-11-11.at.15.48.36.mov
Screen.Recording.2026-11-11.at.21.06.52.mov