-
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
[HOLD for payment 2023-08-28] [$1000] When deleting a file, there is a space between the username and the '[Deleted message]' #24216
Comments
ProposalPlease re-state the problem that we are trying to solve in this issue.When deleting a file or text message, there should be consistent spacing between the username and the '[Deleted message]' What is the root cause of that problem?Here is the difference between space after deleting text message and attachment App/src/pages/home/report/ReportActionItem.js Line 330 in c3bafa6
We have 2 cases:
What changes do you think we should make in order to solve the problem?Here we should check more if the attachment has been deleted or not network: networkPropTypes.isRequired, const pendingAction = lodashGet(props.action, 'pendingAction', ''); !props.displayAsGroup &&
isAttachment &&
(!ReportActionsUtils.isDeletedAction(props.action) ||
(props.network.isOffline && ReportActionsUtils.isDeletedAction(props.action) && pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)) ?
styles.mt2 :
undefined, memo(
ReportActionItem,
(prevProps, nextProps) =>
//...
prevProps.network.isOffline === nextProps.network.isOffline,
), Result:
Screen.Recording.2023-08-08.at.00.36.26.mov
Screen.Recording.2023-08-08.at.00.38.29.movWhat alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.When deleting a file, there is a space between the username and the '[Deleted message]' What is the root cause of that problem?In App/src/pages/home/report/ReportActionItem.js Line 330 in 4230f28
What changes do you think we should make in order to solve the problem?We should also verify that: !props.displayAsGroup && isAttachment && !ReportActionsUtils.isDeletedAction(props.action) ? styles.mt2 : undefined, What alternative solutions did you explore?If we want also want to keep the space while waiting for the attachment to be deleted, we should update to: !props.displayAsGroup && isAttachment && (!ReportActionsUtils.isDeletedAction(props.action) || props.action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) ? styles.mt2 : undefined, |
Triggered auto assignment to @trjExpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.When deleting a file, there is a space between the username and the '[Deleted message]' What is the root cause of that problem?App/src/pages/home/report/ReportActionItem.js Line 330 in 8639fb6
Because we have styles.mt2 for all attachments.
What changes do you think we should make in order to solve the problem?We have to remove What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.After deleting a thread message that is an attachment, the [Deleted Message] still has the margin value that is supposed to be for an attachment only. What is the root cause of that problem?When the message is an attachment, we apply a margin-top of 8. App/src/pages/home/report/ReportActionItem.js Line 314 in 2ce4328
App/src/pages/home/report/ReportActionItem.js Line 330 in 2ce4328
Currently, we check if it's an attachment from the report action
Line 1507 in 2ce4328
Line 1539 in 2ce4328
This property is not available on the BE, so if you logout, The problem is, when we delete a message, we never set the What changes do you think we should make in order to solve the problem?Set App/src/libs/actions/Report.js Lines 882 to 890 in 2ce4328
What alternative solutions did you explore? (Optional)Remove |
Job added to Upwork: https://www.upwork.com/jobs/~019a73e78df922007d |
Current assignee @trjExpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 ( |
Reproducible, moving this on external! @cubuspl42 you're up! :) |
@namhihi237 I think you're missing a
|
@cubuspl42 thanks let me update |
@bernhardoj I like the direction of your root cause analysis and your "alternative solutions" section.
Could you elaborate? |
@DanutGavrus The essence of your proposal is similar to the one above. Yours is shorter because it skips reasoning about the offline/online state. Could you comment on this? Are offline/online checks unnecessary in your opinion? |
I think an offline check is necessary because if no offline check we delete the image, it will remove mt2 even though the image is still showing. |
I was originally thinking that I'm not sure about slow internet connections in which isOffline returns false, but the call may take quite long to execute. I'm thinking relying only on the pendingAction to be enough while we wait for the attachment to be deleted, regarding the online/offline state. Updated alternate Proposal with that approach if anything. |
@cubuspl42 Yes, because the App/src/pages/home/report/ReportActionItem.js Line 314 in 2ce4328
So, the condition will be
|
ProposalPlease re-state the problem that we are trying to solve in this issue.There is a margin after deleting an attachment. What is the root cause of that problem?The external margin is only need for attachments that are not displayed as a group (for attachments that are the first message with avatar and name). Since the margin is applied to a component that renders every type of comment, it will also be applied to the '[Deleted message]' because the message is the first comment and not displayed as a group. What changes do you think we should make in order to solve the problem?We should move the margin and conditions from the current place from here: App/src/pages/home/report/ReportActionItem.js Line 330 in dd21a0b
to:
Since the ThumbnailImage will be rendered here, it's the appropriate place to add the margin. We can wrap it with a View and apply the margin based on the conditions. <View style={[!props.displayAsGroup && props.isAttachment ? styles.mt2 : {}]}>
<RenderHTML ... />
</View> What alternative solutions did you explore? (Optional) |
If the resulting code is valid, this would be definitely one of the best candidates for a solution. A change consisting solely of code removal is always tempting! |
totally agree. Sadly it won't cover the offline case #24216 (comment) 😞 |
@namhihi237 @DanutGavrus @getusha @bernhardoj The attachments have different representations at the time when they're uploaded on the frontend and when they return back from the backend (when they're quite opaquely HTML-encoded). I think we should go with @bernhardoj's proposal, with some minor refactoring which should improve the clarity of the mentioned contracts |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.55-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 2023-08-28. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
|
Hey everyone! Sorry for the delay, I've been out of office. Confirming payments as follows:
|
@trjExpensify offer accepted, Thank you |
Paid! |
@trjExpensify Oh no, I think we shouldn't be getting paid yet as we still have a regression here. (I just realized we haven't linked the regression issue here, my bad) cc: @cubuspl42 |
@trjExpensify It's my fault. Do you know how we can clean this up, or should I start a topic on Slack? I also bumped the PRs that are blocking #25415, I hope we'll soon have this whole thing behind us |
Ah, whoops! I've made the payments on those. I think the easiest thing to do is to simply deduct from your next issue bounties. Do you have any in the works you can make a note on to reduce the amount due accordingly? |
@trjExpensify I have one that is currently pending for payment #23420 |
Excellent, commented there. |
@trjExpensify Here: #25514 |
Thanks, commented! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
When deleting a file or text message, there should be consistent spacing between the username and the '[Deleted message]'
Actual Result:
When deleting a file, there is a space between the username and the '[Deleted message]' message, causing an inconsistency in spacing compared to deleting a text message.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.50-0
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
Notes/Photos/Videos: Any additional supporting documentation
screen-recording-2023-08-01-at-33634-pm_OkJMrkI5.1.mp4
Recording.5751.mp4
Expensify/Expensify Issue URL:
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690887871347529
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: