-
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
[Tracking] Refactor functions with many parameters to use parameter objects #50368
Comments
@neil-marcellini we could start with IOU.getTrackExpenseInformation, IOU.shareTrackedExpense, IOU.categorizeTrackedExpense after these three IOU.trackExpense. |
Job added to Upwork: https://www.upwork.com/jobs/~021846632713060454080 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 ( |
Sure @ChavdaSachin, please go ahead and start with only IOU.categorizeTrackedExpense |
📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @ChavdaSachin 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Sounds good... |
I am OOO for 2 days on an emergency business , will start working as soon as I am back. |
@neil-marcellini, @ChavdaSachin, @dukenv0307 Huh... This is 4 days overdue. Who can take care of this? |
work in progress. |
@neil-marcellini, @ChavdaSachin, @dukenv0307 Still overdue 6 days?! Let's take care of this! |
@neil-marcellini, @ChavdaSachin, @dukenv0307 10 days overdue. I'm getting more depressed than Marvin. |
How's it coming along? |
hi @neil-marcellini sorry for the delay, I am actually trying to implement it on a scale - coz all tracking functions are closely tied together, So I am figuring the whole network these functions have and refactor all at once so that would be a significant improvement and then all tracking related function would probably accept somewhere around 5-7 props that's it. I figured refactoring only one function - IOU.categorizeTrackedExpense would not be much of improvement so... Probably switch it to weekly. |
@neil-marcellini, @ChavdaSachin, @dukenv0307 12 days overdue now... This issue's end is nigh! |
Hi @ChavdaSachin. I appreciate your desire to tackle it all at once, but it's a lot easier for everyone involved if we do it in pieces. It will be faster to get the PR up for review and get it approved. I rather have many small PRs than one big one. Could you please split up your existing work into several PRs? |
Sweet, here's the issue Refactor createDistanceRequest to use a parameter object. |
Hi @neil-marcellini, I see others are working on migrations. Is there another function I can help refactor to use a parameter object? Let me know! Thanks! |
@neil-marcellini next I could work on IOU.shareTrackedExpense function, could you creat new issue? |
@neil-marcellini bump on above^ |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.75-6 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 2024-12-20. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test ProposalTest:Do we agree 👍 or 👎 |
@neil-marcellini Can you take a look at this comment? The PR here was merged for this issue already. |
@neil-marcellini Next I think we can do with |
Issue is ready for payment but no BZ is assigned. @OfstadC you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks! |
Payment Summary
|
Re-opening because this is a tracking issue for the project. Let's handle payment going forward in the separate sub-issues. |
Hi, I created these two new issues and tagged you guys there. Please comment so I can assign. @dukenv0307 moving forward I'm going to let C get automatically assigned, because these PRs tend to be easier reviews and I think it's fair to spread those among other C now. Refactor buildOptimisticTransaction to use a parameter object |
@neil-marcellini And then can you create a separate issue for that PR.?Thanks |
@OfstadC, @neil-marcellini, @ChavdaSachin, @dukenv0307, @mkzie2 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Problem: Many functions in the App repo have a very large amount of parameters, making it very hard to work with them. If you need some data that isn’t available with existing parameters you need to add a new one. The safe way to do that is to add it as an optional param at the end of the list. In order to pass it to the function from an existing call you have to fill in all params between the last one used and this new last param. It’s time consuming to fill out the defaults, and any required params require careful considering. Re-ordering parameters is risky and requires updating all existing calls. Also, we often have cases where we have a transaction object in the component, then call a function passing various fields of the transaction split out into n parameters. Wouldn’t it be so much easier to pass the original object? Sometimes we also pass the ID of the object in Onyx only to retrieve it from an Onyx connection later.
Solution: Gradually refactor functions to take in parameter objects, where it’s easier to re-order. Strive to minimize the number of fields. Group parameters into sensible sub-objects. Thrive 😄
Original Slack thread.
To do list
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @dukenv0307The text was updated successfully, but these errors were encountered: