Skip to content
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 2024-03-29] [$500] Android – Image is reduced for a moment when quickly slide forward/back images using arrows #35615

Closed
1 of 6 tasks
lanitochka17 opened this issue Feb 2, 2024 · 53 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 2, 2024

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.35-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: https://expensify.testrail.io/index.php?/tests/view/4265112
Email or phone of affected tester (no customers): [email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Launch app
  2. Log in
  3. Navigate to a conversation that has 5 or more image attachments in it's history
  4. Click on one of the attachments to open the preview
  5. Click on the forward or back arrow to navigate through the conversation attachments quickly

Expected Result:

The image size is normal when quickly slide forward/back images using the arrows

Actual Result:

The image is reduced for a moment when quickly slide forward/back images using the arrows

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6364145_1706825041063.Attachments.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019fd6243b644a1821
  • Upwork Job ID: 1753212539309678592
  • Last Price Increase: 2024-02-23
  • Automatic offers:
    • abdulrahuman5196 | Reviewer | 0
    • tienifr | Contributor | 0
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 2, 2024
@melvin-bot melvin-bot bot changed the title Attachment – Image is reduced for a moment when quickly slide forward/back images using arrows [$500] Attachment – Image is reduced for a moment when quickly slide forward/back images using arrows Feb 2, 2024
Copy link

melvin-bot bot commented Feb 2, 2024

Job added to Upwork: https://www.upwork.com/jobs/~019fd6243b644a1821

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 2, 2024
Copy link

melvin-bot bot commented Feb 2, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External)

Copy link

melvin-bot bot commented Feb 2, 2024

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@tienifr
Copy link
Contributor

tienifr commented Feb 2, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

The image is reduced for a moment when quickly slide forward/back images using the arrows

What is the root cause of that problem?

In here and here, we're showing the image even though the size was not determined, we use the DEFAULT_IMAGE_DIMENSION as the default in that case, which leads to the image being small for a short time while it loads, then after the image dimensions are loaded, it will show in full size.

What changes do you think we should make in order to solve the problem?

In here and here, make sure the image is not visible while its size is being loaded, we can use opacity: 0, visibilityHidden or similar. While the image is still loading the dimensions, the LoadingIndicator will show here so the UX is smooth.

So in here

style={[contentSize ?? DEFAULT_IMAGE_DIMENSION, !contentSize && {opacity: 0}]}

here

style={[fallbackSize, !contentSize && {opacity: 0}]}

(There're a couple more conditions to determine the fallbackSize here, if we want to make sure to account for that condition, we can return undefined there, then in here if fallbackSize is undefined, fallback to DEFAULT_IMAGE_DIMENSION , and set {opacity: 0} just like we did above in this case)

If we're worried about the onLoad not being triggered if the image is not visible (although when I test on Android, iOS it works fine), we can use Image.getSize inside Image component for native, to determine the sizes rather than relying on Image's onLoad.

What alternative solutions did you explore? (Optional)

Do not render the image altogether if the size is not determined, meanwhile the Image.getSize can be used to populate the contentSize instead

@melvin-bot melvin-bot bot added the Overdue label Feb 5, 2024
@abdulrahuman5196
Copy link
Contributor

abdulrahuman5196 commented Feb 5, 2024

Will work on review today

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Feb 5, 2024
@johncschuster
Copy link
Contributor

Bumping for Melvin

@melvin-bot melvin-bot bot removed the Overdue label Feb 7, 2024
Copy link

melvin-bot bot commented Feb 9, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Feb 9, 2024
@kbecciv kbecciv changed the title [$500] Attachment – Image is reduced for a moment when quickly slide forward/back images using arrows [$500] Android – Image is reduced for a moment when quickly slide forward/back images using arrows Feb 9, 2024
@abdulrahuman5196
Copy link
Contributor

Sorry for the delay. Working on review now

@melvin-bot melvin-bot bot removed the Overdue label Feb 12, 2024
@abdulrahuman5196
Copy link
Contributor

@tienifr From the proposal here #35615 (comment),
To summarize, we show the image before the image size is determined by the system, causing it to show in a fallback size. The suggestion is to not show the image and show the loading indicator.

@johncschuster This expectation seems fine IMO, But I would like to confirm the expectation.

@abdulrahuman5196
Copy link
Contributor

Followup question to @tienifr
Is there a way to re-use the image sizes which we got previously?

@tienifr
Copy link
Contributor

tienifr commented Feb 12, 2024

Followup question to @tienifr
Is there a way to re-use the image sizes which we got previously?

@abdulrahuman5196 Yes, we can re-use it by not setting the contentSize (and subsequently the cachedImageDimensions cache value) to undefined here when the current lightbox becomes invisible. But this won't fix the issue fully because the issue will still happen when the image is rendered the first time. I agree though that we can surely consider it as a further optimization.

@melvin-bot melvin-bot bot added the Overdue label Feb 14, 2024
@johncschuster
Copy link
Contributor

@abdulrahuman5196 / @tienifr To make sure I understand:

The suggestion is to not show the image and show the loading indicator.

Are you suggesting that we shouldn't show an image at all when a user is in image preview mode and swiping through images, and instead show a loading indicator?

@melvin-bot melvin-bot bot removed the Overdue label Feb 14, 2024
@tienifr
Copy link
Contributor

tienifr commented Feb 15, 2024

@johncschuster no, let me clarify

When swiping to the next image, currently it will show a small image in the center of the screen, with a loading indicator, then after the image is fully loaded, it will show with correct size.

The suggestion is to not show the small image initially. Instead, it will only show loading indicator while the image is loading (which is brief), then after the image is loaded and the size is known, the full image will be shown with the correct size from the start (rather than showing image with incorrect size first then change to correct size as currently)

@abdulrahuman5196
Copy link
Contributor

abdulrahuman5196 commented Feb 16, 2024

Are you suggesting that we shouldn't show an image at all when a user is in image preview mode and swiping through images, and instead show a loading indicator?

Not a suggestion. I would put it as a question instead.

@tienifr proposal here #35615 (comment) targets to do, also explained in detail here #35615 (comment). My question would be, Is it good enough from UX perspective? or should we try out for more optimized fix(which would be reach out for other proposals)?

@iwiznia iwiznia added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Mar 1, 2024
Copy link

melvin-bot bot commented Mar 1, 2024

Current assignee @abdulrahuman5196 is eligible for the External assigner, not assigning anyone new.

@iwiznia
Copy link
Contributor

iwiznia commented Mar 1, 2024

@tienifr bump

@melvin-bot melvin-bot bot added the Overdue label Mar 4, 2024
@abdulrahuman5196
Copy link
Contributor

Hmmmm but is the proposal from @tienifr making the LoadingIndicator show? I see you said:

the LoadingIndicator will show here so the UX is smooth.

So, maybe how this works is like this?

* Image is loading (loading indicator shows)

* Image loaded, but dimensions not determined yet (loading indicator is not there and image is neither as its opacity is 0)

* Image loaded, dimensions computed (image shows properly)

@iwiznia I don't exactly understand the question here. But as far as the usecase goes, we will show the image only after the image is loaded and the dimensions are computed. Until then loader will be shown.
Hope it clarifies.

@melvin-bot melvin-bot bot removed the Overdue label Mar 4, 2024
@tienifr
Copy link
Contributor

tienifr commented Mar 4, 2024

So, maybe how this works is like this?

@iwiznia There're only 2 phases instead of 3:

  1. Image is not fully loaded, dimensions not determined yet (loading indicator shows)
  2. Image loaded, dimensions computed (image shows properly)

The only difference compared to the current flow is that in step 1:

  • Currently: loading indicator shows and the image with the wrong size is shown briefly
  • After the change: only loading indicator will show

@iwiznia
Copy link
Contributor

iwiznia commented Mar 4, 2024

Currently: loading indicator shows and the image with the wrong size is shown briefly

Ahhh got it!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 4, 2024
Copy link

melvin-bot bot commented Mar 4, 2024

📣 @abdulrahuman5196 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Mar 4, 2024

📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Mar 5, 2024
@tienifr
Copy link
Contributor

tienifr commented Mar 5, 2024

PR ready for review #37739.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 22, 2024
@melvin-bot melvin-bot bot changed the title [$500] Android – Image is reduced for a moment when quickly slide forward/back images using arrows [HOLD for payment 2024-03-29] [$500] Android – Image is reduced for a moment when quickly slide forward/back images using arrows Mar 22, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 22, 2024
Copy link

melvin-bot bot commented Mar 22, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Mar 22, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.55-3 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-03-29. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Mar 22, 2024

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:

  • [@abdulrahuman5196] The PR that introduced the bug has been identified. Link to the PR:
  • [@abdulrahuman5196] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@abdulrahuman5196] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@abdulrahuman5196] Determine if we should create a regression test for this bug.
  • [@abdulrahuman5196] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@tienifr
Copy link
Contributor

tienifr commented Apr 1, 2024

@johncschuster @abdulrahuman5196 Please handle payments. Thanks!

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

Not a regression.

Determine if we should create a regression test for this bug.

Yes.

If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

  1. Send many images to a report (about 5)
  2. Press an image
  3. Quickly press the arrows to navigate between those images in carousel
  4. Verify that while image is still loading, we only shows the loading indicator

@johncschuster

@johncschuster
Copy link
Contributor

Payment has been issued and regression test issue has been created. Closing! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants