-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$500] Expense - Receipts in the expense preview do not update after adding/deleting receipt #33550
Comments
Job added to Upwork: https://www.upwork.com/jobs/~0198c10fd73498b28a |
Triggered auto assignment to @Christinadobrzyn ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The number of transactions with receipts on the report preview doesn't update. What is the root cause of that problem?The transaction with a receipt is calculated here.
In getTransactionWithReceipts, we get all transactions that are linked with the passed IOU report id. Lines 1898 to 1901 in b74be72
However, it won't rerender when the transaction collection is updated (added/removed) because we aren't subscribing the component with the transaction collection. Instead, we use a different technique here by using App/src/components/ReportActionItem/ReportPreview.js Lines 209 to 229 in b74be72
(here is the reason why we do this) What changes do you think we should make in order to solve the problem?If we want to keep the
What alternative solutions did you explore? (Optional)Otherwise, we can subscribe to the whole collection and use a selector to only select the transaction that is linked with the IOU report id. We will need to make a lot of changes to the code too, for example, we need to pass the transaction array to |
ProposalPlease re-state the problem that we are trying to solve in this issue.The receipts in the expense preview in workspace chat does not update. It only shows +1 counter after refreshing the page What is the root cause of that problem?We use transactionsWithReceipts to get the receipts here Here's the detail implementation of getTransactionsWithReceipts, we get all transactions from onyx.connect Lines 1898 to 1901 in 7b836cf
In theory, when the transactions get changed, But in What changes do you think we should make in order to solve the problem?We should cover all places that use data from
we're getting
If we just create the new state for it and update in To address this issue, we should create the new state for
What alternative solutions did you explore? (Optional)NA |
@cubuspl42, @Christinadobrzyn Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@bernhardoj @tienifr Would you consider adding to your GitHub profile...
|
@cubuspl42 sorry to hear that, I have added a profile picture |
Can you use The surrounding |
@cubuspl42 Ah, I mean using transactionsWithReceiptsRef, we can use the previous transactionsWithReceipts through ref in callback function. I updated my proposal to use ref as well |
Now
Have you tested these changes? While I agree that it might be beneficial to give some focus to the performance here, the code must first and foremost work. Would you share the branch with the code you used for testing that the proposed solution works as expected? |
@cubuspl42 Here you are: https://github.com/tienifr/App/tree/fix/33550 Evidence video: Screen.Recording.2023-12-29.at.17.24.25.mov |
Thank you! I'm still in two minds with this one, though... While it's good that the proposal tries to focus on providing good performance, the exact solution feels somewhat hacky. We're using both a ref and a state property to store Do you know what's the performance characteristic of your solution? How often would |
@cubuspl42 because we subscribe to the whole transaction,
I guess we can do something like this to prevent the re-render if the array contents are the same.
Talking about the performance, the current usage of App/src/components/ReportActionItem/ReportPreview.js Lines 214 to 226 in 4a7014b
Even though it doesn't cause a re-render, the four util functions make the same multiple loops to get all or linked transactions. If we really want to improve the performance here, we can create like a wrapper for report preview like below. The 4 util functions above now only need to accept the transactions collection instead of the iou report ID.
And then memoized the ReportPreview. memo(ReportPreview, (prevProps, nextProps) => _.isEqual(prevProps, nextProps)) Many things can be done to improve the performance, theoretically (because I didn't do any measurement). |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@cubuspl42, @Christinadobrzyn Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@cubuspl42, @Christinadobrzyn Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
This comment was marked as off-topic.
This comment was marked as off-topic.
@puneetlath, @cubuspl42, @Christinadobrzyn Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
The proposal and the proposed compensation sounds good to me. Good by you @bernhardoj? If so, I'll assign you. |
@puneetlath I'm good with that |
@puneetlath @cubuspl42 @Christinadobrzyn this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks! |
📣 @cubuspl42 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Assigning @bernhardoj. Agreed payment breakdown here: #33550 (comment) |
Actually, I wasn't able to reproduce this anymore because in this PR, we connect to the whole transactions collection 😅 |
Oh my, so this was one of those that you can wait out... |
Ah, wow ok. So sounds like nothing to do here and we should just close the issue out? Thanks for all the discussion though! |
@puneetlath @cubuspl42 @bernhardoj @Christinadobrzyn this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks! |
Current assignee @cubuspl42 is eligible for the Internal assigner, not assigning anyone new. |
@cubuspl42 can you let us know what you think is fair for the partial payment? |
Based on this Slack convo - https://expensify.slack.com/archives/C02NK2DQWUX/p1705917174041169 I paid out @cubuspl42 $125 (25% of $500) for the job. The payment is through Upwork. Feel free to reach out with any questions! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.16-4
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:
Precondition: There are more than 3 requests in the workspace chat and 3 of them have a receipt
Expected Result:
The receipts in the expense preview in the workspace chat will update and +1 counter will show
Actual Result:
The receipts in the expense preview in workspace chat does not update. It only shows +1 counter after refreshing the page
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6324986_1703347995567.1000005049.1.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: