You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2025-02-04] [$250] Remove the getTripTransactions method #55077
When getTripTransactions() is called, it accesses data from Onyx that the view is not connected to. This breaks the reactivity of the component because when the transactions are updated in Onyx, the component won't receive the changes. This leads to stale data.
Please re-state the problem that we are trying to solve in this issue.
When getTripTransactions() is called directly in the component, it accesses Onyx data that the component is not connected to. This breaks reactivity because the component won't re-render when the underlying transactions data changes in Onyx, leading to stale data being displayed to users.
What is the root cause of that problem?
The root cause is that we're accessing Onyx data through a utility function without establishing a proper subscription to that data.
What changes do you think we should make in order to solve the problem?
Instead of calling getTripTransactions() directly, we should connect to the data using useOnyx with a selector that utilizes the existing utility function. Like this:
here:
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.89-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@shubham1206agra@isabelastisser@shubham1206agra The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
Activity
melvin-bot commentedon Jan 10, 2025
Triggered auto assignment to @isabelastisser (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.melvin-bot commentedon Jan 10, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021877740338376092500
[-]Remove the `getTripTransactions` method[/-][+][$250] Remove the `getTripTransactions` method[/+]melvin-bot commentedon Jan 10, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (
External)shubham1206agra commentedon Jan 10, 2025
@tgolen You need to assign me for review as no one has trip rooms set up right now.
mohit6789 commentedon Jan 10, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Make changes in getTripTransactions() so it will use reports using withOnyx() instead of Onyx.connect
What is the root cause of that problem?
Improvement remove getTripTransactions and use withOnyx()
What changes do you think we should make in order to solve the problem?
App/src/libs/ReportUtils.ts
Lines 8175 to 8183 in 3541c89
App/src/components/ReportActionItem/TripDetailsView.tsx
Line 149 in 3541c89
App/src/components/ReportActionItem/TripRoomPreview.tsx
Line 120 in 3541c89
changes in both the components
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
github-actions commentedon Jan 10, 2025
github123 Your proposal will be dismissed because you did not follow the proposal template.
Shahidullah-Muffakir commentedon Jan 10, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
When getTripTransactions() is called directly in the component, it accesses Onyx data that the component is not connected to. This breaks reactivity because the component won't re-render when the underlying transactions data changes in Onyx, leading to stale data being displayed to users.
What is the root cause of that problem?
The root cause is that we're accessing Onyx data through a utility function without establishing a proper subscription to that data.
What changes do you think we should make in order to solve the problem?
Instead of calling getTripTransactions() directly, we should connect to the data using useOnyx with a selector that utilizes the existing utility function. Like this:
here:
App/src/components/ReportActionItem/TripDetailsView.tsx
Line 149 in 3541c89
and here:
App/src/components/ReportActionItem/TripRoomPreview.tsx
Line 120 in 3541c89
write it like this:
and accept reports as param in the getTripTransactions
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
25 remaining items
melvin-bot commentedon Jan 28, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jan 28, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.89-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-02-04. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 28, 2025
@shubham1206agra @isabelastisser @shubham1206agra The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
cristipaval commentedon Jan 29, 2025
I'm making this my top priority: #55754
isabelastisser commentedon Feb 4, 2025
@shubham1206agra @blazejkustra, any updates with the PR? Is this issue awaiting payment?
shubham1206agra commentedon Feb 4, 2025
@isabelastisser PR was merged already
This is waiting for payment
And there are no tests to be added here
isabelastisser commentedon Feb 6, 2025
@shubham1206agra, please accept the offer in Upwork, and I will process the payment. Thanks!
shubham1206agra commentedon Feb 6, 2025
@isabelastisser Offer accepted
isabelastisser commentedon Feb 19, 2025
@shubham1206agra I sent you a new offer in Upwork.