Skip to content

Revert "fix: reland Search re-fire fix with the deploy blocker regressions closed" - #98728

Closed
Beamanator wants to merge 1 commit into
mainfrom
revert-98558-fix/search-refire-reland
Closed

Beamanator wants to merge 1 commit into
mainfrom
revert-98558-fix/search-refire-reland

Conversation

@Beamanator

Copy link
Copy Markdown
Contributor

Reverts #98558

Can test adhoc build with this revert before merging

Fixes:
$ #98698
$ #98723

@Beamanator
Beamanator requested review from a team as code owners August 16, 2026 17:54
@melvin-bot
melvin-bot Bot requested review from chuckdries and garrettmknight and removed request for a team August 16, 2026 17:55
@melvin-bot

melvin-bot Bot commented Aug 16, 2026

Copy link
Copy Markdown

@chuckdries 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]

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b21b91f82c

ℹ️ 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".


// Check if there is a change in the transactions or report actions list
if ((isChat ? hasReportActionsIDsChange : hasTransactionsIDsChange || hasChangedResultTransaction) || hasPendingSearchRef.current) {
if ((!isChat && hasTransactionsIDsChange) || hasReportActionsIDsChange || hasPendingSearchRef.current) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Refetch after editing a visible expense

When an expense already present in the Search snapshot is edited—for example, its amount, category, or date changes—the transaction key set remains unchanged, so this condition never calls search(). Snapshot-backed rows, filter membership, and server-calculated footer totals therefore continue showing the pre-edit values until another event refreshes the search.

Useful? React with 👍 / 👎.

Comment on lines 2163 to 2164
);
refreshSearchAfterReportAction({
currentSearchQueryJSON,
currentSearchKey,
shouldCalculateTotals: shouldCalculateTotalsOnRefresh,
isOffline,
isLoading: !!currentSearchResults?.search?.isLoading,
});
clearSelectedTransactions();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Refresh the snapshot after submitting from Search

When Submit is used from an ordinary advanced search rather than the live Submit suggested search, submitMoneyRequestOnSearch() updates loading/report data but does not update the Search snapshot. Clearing the selection immediately without refetching leaves the old report context in the rows, so Submit can remain offered and report-derived values stay stale after a successful submission.

Useful? React with 👍 / 👎.

Comment on lines +119 to +125
const newIDs = isChat ? reportActionsIDs : transactionsIDs;
let currentSearchResultIDs: string[] = [];
if (searchResultsData) {
currentSearchResultIDs = isChat ? extractReportActionIDsFromSearchResults(searchResultsData) : extractTransactionIDsFromSearchResults(searchResultsData);
}
const existingSearchResultIDsSet = new Set(currentSearchResultIDs);
const hasAGenuinelyNewID = (isChat ? reportActionsIDs : addedTransactionIDs).some((id) => !existingSearchResultIDsSet.has(id));
const hasAGenuinelyNewID = newIDs.some((id) => !existingSearchResultIDsSet.has(id));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compare transaction values using bare IDs

When the transaction collection catches up with an item already present in the Search snapshot, transactionsIDs contains Onyx keys such as transactions_2, while extractTransactionIDsFromSearchResults() returns bare IDs such as 2. Consequently hasAGenuinelyNewID is always true for a nonempty collection, defeating the guard and issuing a redundant Search request even though the added collection entry is already displayed.

Useful? React with 👍 / 👎.


// Check if there is a change in the transactions or report actions list
if ((isChat ? hasReportActionsIDsChange : hasTransactionsIDsChange || hasChangedResultTransaction) || hasPendingSearchRef.current) {
if ((!isChat && hasTransactionsIDsChange) || hasReportActionsIDsChange || hasPendingSearchRef.current) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Ignore report-action changes for non-chat searches

When any report action is appended while an expense or report search is open, the unconditional hasReportActionsIDsChange branch enters the refresh path even though report actions only drive chat searches. A comment or action written elsewhere can therefore reissue the active non-chat Search query and unnecessarily reload its snapshot.

Useful? React with 👍 / 👎.

@Beamanator

Copy link
Copy Markdown
Contributor Author

triggered an adhoc build, let's not merge till that is confirmed fixing the bug(s)

@github-actions

Copy link
Copy Markdown
Contributor

🚧 Beamanator has triggered a test Expensify/App build. You can view the workflow run here.

@mountiny mountiny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would really want to deliver this to production as soon as possible, since it should be fixing extra Search calls putting extra load on our backend. approving this revert, but in case we could wait for monday morning to give @BartekObudzinski chance to fix the blockers, that would be nice. But its up to you!

@mountiny

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari

@BartekObudzinski

Copy link
Copy Markdown
Contributor

Working on the deploy blockers right now if the revert is not merged yet @mountiny

@mountiny

Copy link
Copy Markdown
Contributor

Going ahead with the fix pr for now #98752

@mountiny

Copy link
Copy Markdown
Contributor

Both fixed with the cp so we can close this 🎉

@mountiny mountiny closed this Aug 17, 2026
@Beamanator

Copy link
Copy Markdown
Contributor Author

nice!!! thanks y'all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants