-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix: fall back to Onyx transactions for grouped view actions and default merchant sort to ASC #82053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dangrous
merged 8 commits into
Expensify:main
from
TaduJR:feat-Insights-Release-2-Top-Merchants-Add-group-by-merchant-and-suggested-search
Feb 27, 2026
Merged
fix: fall back to Onyx transactions for grouped view actions and default merchant sort to ASC #82053
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
10687df
fix: fall back to Onyx transactions collection for grouped view actio…
TaduJR f0e1354
fix: default merchant sort to groupMerchant ASC matching category beh…
TaduJR f701771
Merge branch 'main' of https://github.com/TaduJR/App into feat-Insigh…
TaduJR 0aaaf88
refactor: move groupByToSortColumn to module-level constant
TaduJR abe37dd
chore: run prettier
TaduJR 9569cd1
fix: inline template literals to preserve PrefixedRecord key types
TaduJR 7a91484
chore: run prettier
TaduJR 2e33df1
test: add sort default tests for Top Categories and Top Merchants
TaduJR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also include
transactionsin the deps.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transactions is intentionally excluded. It's the entire Onyx transaction collection
useOnyx(ONYXKEYS.COLLECTION.TRANSACTIONand updates on every transaction change app-wide.I think adding it would cause expensive useEffect to re-run for unrelated transaction changes.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then the effect won’t re-run when only Onyx transactions change which might lead to stale data. Wouldn't it be a problem? Or instead of the full transactions collection, is it feasible to use a narrowed subscription/selector ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified with debug loggers. On a page load with 3 Open expenses, transactions (the full Onyx collection) fires ~30+ times from property-only changes while hasTransactionsIDsChange=false every time meaning these are all property updates on existing transactions, not new/deleted ones.
Adding transactions to deps wouldn't fix stale data either filteredData (which drives the iteration inside the effect) is built from the search snapshot, not live Onyx. So the effect would re-run ~30+ extra times but still iterate stale snapshot data.
A narrowed selector has a circular dependency problem: we'd need filteredData transaction IDs to build the selector, but the effect depends on filteredData. I tried to search but there's also no existing codebase pattern using a selector on a full collection key.
So I think the ?? transactions fallback is only a lookup for grouped views where searchResults.data lacks individual transaction keys it's read at execution time with whatever value it has, not a reactivity source.