Description
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:
- Open a report
- Send 3-4 images/pdf's
- Scroll through carousel multiple times
Expected Result:
The loader should not appear on top of the image if the image is already loaded
Actual Result:
The loader appears on top of the image even if the image is already loaded
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- Android / native
- Android / Chrome
- iOS / native
- iOS / Safari
- MacOS / Chrome / Safari
- MacOS / Desktop
Version Number: 1.3.57-5
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
WhatsApp.Video.2023-08-19.at.16.46.18.mp4
Record_2023-08-27-22-02-15_4f9154176b47c00da84e32064abf1c48.mp4
Expensify/Expensify Issue URL:
Issue reported by: @Krishna2323
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692443921240289
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01e48d51a0940adaac
- Upwork Job ID: 1699172582322225152
- Last Price Increase: 2023-09-12
- Automatic offers:
- Krishna2323 | Contributor | 26743909
- krishna2323 | Reporter | 26743910
Activity
melvin-bot commentedon Aug 28, 2023
Triggered auto assignment to @sakluger (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 28, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)pradeepmdk commentedon Aug 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Chat - Loader is shown on top of image even after image is loaded in attachment carousel
What is the root cause of that problem?
from this PR https://github.com/Expensify/App/pull/20798/files#diff-d0e9c4b27eeb3cf558959584e3c3ea569b9a70c4fa1334846ac028a504cf035d introduced
ImageTransformerso every timeisActiveimage will transformApp/src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPage.js
Lines 76 to 77 in d09a1b6
What changes do you think we should make in order to solve the problem?
we should check image is already Transformed or not. This
AttachmentCarouselPageis loaded from Flatlist so we need to declare one more stateand here
App/src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPage.js
Line 102 in d09a1b6
setIsImageTransformered(true);and on
onLoadEndas well.and
App/src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPage.js
Line 118 in d09a1b6
add onLoadEnd={() => setIsImageTransformered(true)}
the loader should show if the image is not Transforming only
isActive && !isImageTransformeredResult
Screen.Recording.2023-09-15.at.6.51.36.AM.mov
Krishna2323 commentedon Aug 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Chat - Loader is shown on top of image even after image is loaded in attachment carousel
What is the root cause of that problem?
Our loader is configured to show as soon as the loading process began, without distinguishing between images loaded from the cache and those fetched from the internet. This meant that even if an image was instantly available in the cache and displayed immediately, our loader logic would still interpret this as a loading sequence. As a result, the isLoading state would momentarily set to true, only to revert back to false instantly, causing the loading indicator to flash or flicker briefly.
I already fixed similar issue few weeks ago: PR
What changes do you think we should make in order to solve the problem?
To address the flickering loader issue, we should introduce a slight delay before showing the loader, allowing cached images to display without triggering the loading indicator. Simultaneously, we need to enhance our mechanism for tracking image load status, ensuring that once an image is loaded, its status is remembered, preventing unnecessary loader displays for cached images. Synchronizing the fallback display with the image's actual load status will further mitigate the flash of the loader. Lastly, optimizing the caching of image dimensions will expedite image rendering, contributing to a smoother user experience.
Imports:
State Variables:
Refs:
const isLoadedRef = useRef(null);Effects:
Image Component:
ActivityIndicator:
Result
fix_demo.mp4
melvin-bot commentedon Aug 31, 2023
@sakluger Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
sakluger commentedon Aug 31, 2023
sakluger commentedon Aug 31, 2023
Krishna2323 commentedon Aug 31, 2023
@sakluger, that's what I was thinking 😂
63 remaining items
melvin-bot commentedon Oct 2, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Oct 2, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.75-12 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-10-09. 🎊
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:
melvin-bot commentedon Oct 2, 2023
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:
Krishna2323 commentedon Oct 9, 2023
@sakluger, bump for payments here, just noting this issue was created on Aug 28.
eVoloshchak commentedon Oct 11, 2023
eVoloshchak commentedon Oct 11, 2023
Regression Test Proposal
Do we agree 👍 or 👎
sakluger commentedon Oct 12, 2023
@Krishna2323 thanks for the reminder on the issue creation date. I updated the offers accordingly.
@eVoloshchak does not require payment (Eligible for Manual Requests)
@Krishna2323 requires payment offer (Contributor)
@Krishna2323 requires payment offer (Contributor)
Summarizing payouts for this issue:
Reporter: @Krishna2323 $250 (paid via Upwork)
Contributor: @Krishna2323 $1000 (paid via Upwork)
Contributor+: @eVoloshchak $1000 (payable via Manual Request)
Above payments include efficiency bonus 🎉
Upwork job: https://www.upwork.com/jobs/~01e48d51a0940adaac
sakluger commentedon Oct 12, 2023
@eVoloshchak let me know once you've sent the manual request, I'll close the issue at that point. Thanks!
eVoloshchak commentedon Oct 12, 2023
@sakluger, request has been sent, thank you!
JmillsExpensify commentedon Oct 12, 2023
$1,000 payment approved for @eVoloshchak based on BZ summary.