-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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-05-23] [$1000] image changes automatic when image preview is opened and sender sends any new image #17743
Comments
Triggered auto assignment to @JmillsExpensify ( |
Bug0 Triage Checklist (Main S/O)
|
I'm not able to reproduce this one. I followed the reproduction steps using both file upload as well as drag and drop. The preview didn't switch on me. Mind confirming the bug can reproduced using these exact reproduction steps? |
@JmillsExpensify Please try to create a new chat, I am able to reproduce it screen-recording-2023-04-21-at-101019-am-1_XzaoqqP6.mp4 |
Ah ok! So creating a new chat does it for me as well. Thanks! |
Job added to Upwork: https://www.upwork.com/jobs/~01f32126fc3213fe91 |
Current assignee @JmillsExpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Triggered auto assignment to @cead22 ( |
For anyone who wants to take this on, here are my initial observations:
@kidroca I see that you did some changes to this component a little while ago. Do you know what might be the issue here? |
ProposalPlease re-state the problem that we are trying to solve in this issue.The current image being displayed in the attachment carousel automatically changes when a new image attachment is added to the report. What is the root cause of that problem?There are multiple things causing with the implemented logic in the In the
When this happens on subsequent updates, the order of the attachments array changes, because the second image in the report now becomes the first in order (descending order), thereby causing the What changes do you think we should make in order to solve the problem?Change the What alternative solutions did you explore? (Optional)It's possible to keep the
However, with this approach, there is a need to also add another loop to keep the correct page value based on the number of attachments.
The check and parameter swaps in the proposed changes will also need to be applied. Ultimately, this will result in more expensive operations, which makes the original proposed change a better idea. |
@allroundexperts The image changes because we insert an image in the list @akinwale If you reverse the list, you would have the same problem, just on the other side of the list |
I haven't seen the problem exhibit itself, and I don't think it happens if the list order always remains the same. We're always starting from the first item in the report, and so the page index always stays the same for the current item (if there's any). With ascending order, we're inserting the newer items at the end of the list, instead of the beginning (which is what is happening with the current descending order). |
ProposalPlease re-state the problem that we are trying to solve in this issue.Observed attachment image might change if someone sends a new attachment while we have the attachment view/carousel open What is the root cause of that problem?The problem is we try to recalculate attachments and fit the new attachment into the list - why do we do that?
What changes do you think we should make in order to solve the problem?A solution, like stop trying to recalculate attachments after the carousel is open, is simple and efficient
The carousel should include all the attachments available at the time when we open the carousel (Just checked and WhatsApp's attachment carousel works this way - new attachment don't appear until you exit the carousel) What alternative solutions did you explore? (Optional)In my previous comment I've explained how content in the list might shift depending on where we insert data Simply said, any time we use the (This should also cover images getting deleted and causing indexes to change, though if we were looking at a image that got deleted, we'll be moved to the neighboring image) |
But why does it happen when you're on the first image only? |
Here are two cases:
I believe when user deletes an attachment, it should be removed from carousel as well (same is the case in WhatsApp as well). When user sends a new attachment, should it be accessible without closing the carousel and re-opening it? @kidroca You are proposing not to remove the deleted image from the carousel until it is closed, right? It is not the case in WhatsApp. I think it makes sense to remove the image from the carousel once deleted. @cead22 @JmillsExpensify What's your opinion on the expected output? |
For deletion, this will be a bit tricky if the image is the currently displayed image, because it will cause the If the intent is to dynamically handle deletion, a good approach would be to only update carousel if:
My proposal fixes the issue with dynamically added images changing the current displayed image fine, but not deletion. I can run some tests and update it to cover the deletion cases. |
@sobitneupane Another thing to note, at the moment, the current behaviour when an image attachment is deleted is that no changes happen in the carousel while it's already open. This is probably due to the fact that there is no |
I'm not particularly passionate, though I agree that if we need to refresh the carousel for the case of deleted, I think that'd cause more confusion by the user – or perhaps more accurately, is jarring. |
Triggered auto assignment to @miljakljajic ( |
Also OOO, reapplying. |
Triggered auto assignment to @laurenreidexpensify ( |
@sobitneupane @kidroca @gadhiyamanan the original job expired on Upwork, I've resent you all offers on a new one - please apply here https://www.upwork.com/jobs/~01b269c8c394133c7a thanks |
@laurenreidexpensify Accpted, Thanks! |
@sobitneupane have you had a chance to review regression steps above? |
@sobitneupane @gadhiyamanan paid ✔️ |
https://expensify.slack.com/archives/C049HHMV9SM/p1684918537590419 |
Regression Test Proposal
Do we agree 👍 or 👎 |
@laurenreidexpensify am I eligable for the bonus mentioned here: #17743 (comment)
The PR was merged within 72hrs of my assignment |
sorry missed the bonus @kidroca @sobitneupane - fixed! |
@sobitneupane regression test looks good, do you have a recommendation for which test it would live under in TestRail? |
@laurenreidexpensify I am not familiar with TestRail. Is there any document/ walkthrough video/ slack thread to familiarize with TestRail? |
ah apols Sobit - Reading through https://github.com/Expensify/App/blob/main/contributingGuides/REGRESSION_TEST_BEST_PRACTICES.md I can see that you don't have access to TestRail, so ignore me! Testing steps look good, have created an issue for it to get added to TestRail. All steps completed here, closing. Thanks everyone! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
Image should not changes automatically
Actual Result:
Image changes automatically
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.2
Reproducible in staging?: y
Reproducible in production?: y
Notes/Photos/Videos:
Screen.Recording.2023-04-20.at.12.08.18.PM.mov
Recording.292.mp4
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681972760701989
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: