-
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
Remove unused attachment placeholder code #25557
Remove unused attachment placeholder code #25557
Conversation
8ccf412
to
82713e6
Compare
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.
Is the property supposed to be set by the backend?
I don't see any instance of isLoading
in our backend code, so I guess not.
Is this code supposed to execute or is it some leftover?
No idea honestly, but if it's unreachable I think it's pretty safe to just remove it?
@@ -23,9 +23,6 @@ export default { | |||
IOUTransactionID: PropTypes.string, | |||
}), | |||
|
|||
/** Whether we have received a response back from the server */ | |||
isLoading: PropTypes.bool, |
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.
@marcaaron Any thoughts? You are to blame for this line 😉
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 searched for isLoading
and "isLoading"
in the frontend code-base and I couldn't find any set of this property in the context of report actions.
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.
LGTM - @marcaaron let us know your thoughts 🙇
yes, it is a relic! replaced with the I would assume based on the age of that PR that anything referencing |
Is there some linked issue though to go with this? What prompted this change? |
It started with this issue about some inconsistent 8px margin. I was the C+ reviewer. We introduced a regression trying to fix that inconsistency. I concluded that the reason why it's so difficult to apply that simple margin properly is the unnecessary complexity of the surrounding code. So now I'm cleaning it up, then I'll rebase #25524 on top of those cleanups. I hope it makes sense. |
I don't want to discourage your efforts (which we are appreciative of and seems like this is necessary cleanup). But I think it doesn't really make sense - or at least is unusual or outside of our normal process. Typically, if you want to do a refactor then you would propose somewhere the scope of the work. Then we create an issue for it. Then we accept that proposal. And then a PR like this get created and be linked to the issue. Then you will get compensated for it. Let me know if I am missing something. |
I think it does make sense, but might indeed be outside of the process.
I don't expect to be compensated for these cleanup PRs. And I skipped the formalities because the gain of removing the dead code and obvious duplication is hardly debatable. As I understand, per the process C/C+ are obligated to fix the regression if it occurs during the regression period. Do you confirm that? So the only thing which is outside the process is that I classified the root cause of the regression lying in the unnecessary code complexity and organized the fix into a few smaller PRs, instead of 1 big one. |
Yes, the change makes sense - sorry the explanation is what did not make sense to me because it looked (to me) like we did not quite follow process. To be sure, removing the code and all that is a good thing. Since this is part of the solution to a regression then my recommendation would be to just link to the original issue in the description of this PR (so everyone can understand the context for the change). If you have made some plan to do the cleanup and got the approval to proceed then link to where that conversation happened. To clarify my initial concern, it's that you might have been doing some random cleanup for which you would not be compensated for and nobody asked for. I see now that is a misunderstanding and that @Li357 gave you a green light already to open this PR. |
I still cannot see a problem here... I know that in general, it might be a challenge to accept PRs from the whole community because it's a cost to review them and might have negative net gain, but I think it's a bit different situation with the C+ group, who are filtered and have more experience in the project. We are also in the Expensify GitHub organization if that means anything. If during a review I accidentally see some dead code (let's say in a file not strictly related to the solved issue), what am I supposed to do?
This? If that's the expectation, I will just pretend I didn't see that dead code, and so will others (or they already are doing that). I'm not gonna argue about this, but I think that if anything, it's this specific part of the process that makes little sense. But coming back to this PR, are we ready to push it forward? |
Overall, thanks for the thoughts and feedback! ❤️
This is not situation we have here though after reviewing the linked issue. So, perhaps we would like to restart this conversation in Slack with different context?
It happens rarely in my experience. But sounds worth discussing. We have various initiatives (particularly urgent ones at the moment) and a small internal team so it unfortunately does not always make sense to accept every improvement. But if we want to have some larger discussion about whether C+ team should feel empowered to submit improvement PRs without any connection to an issue then I would encourage it. 👍 Internally, most of us submit PRs connected to issues, but in very rare cases we do not. We are also salaried. So, my concerns with what you are suggesting boil down to:
Only remaining problem I see is this @cubuspl42: |
@marcaaron I linked #25415 as the "Fixed issue", although I don't fix it (yet), so it's fiction. I hope that satisfies the process, though. I don't have any idea what proposal I could link. |
@situchan Can we move this forward? |
Server is down - https://expensify.slack.com/archives/C01GTK53T8Q/p1695314249132269 |
Can we merge this @situchan ? |
yes, we can. For safety, I wanna test based on latest codebase as 1415 commits are too behind |
@situchan Done |
Bump @situchan |
@situchan Also, you can always merge |
Job 2 is failing. So still pull main |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-09-29.at.2.30.06.PM.mov
Screen.Recording.2023-09-29.at.2.38.19.PM.movMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
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.
Confirmed the behavior is exactly same as main
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/flodnv in version: 1.3.76-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.76-6 🚀
|
🚀 Deployed to staging by https://github.com/flodnv in version: 1.3.77-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.77-7 🚀
|
Details
I found this when working on #25415. Discussed here in a draft PR which I'd like to rebase on this one.
This code path seems to never trigger, as the report action's
isLoading
property seems to never be set.Open questions:
Removing this will simplify fixing #25415.
Fixed Issues
Helps with #25415
Tests
Offline tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
nuke-unused-attachment-preview-web.mp4
nuke-unused-attachment-preview-web-2.mp4
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android