-
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-10-02] [$1000] image loads on reesize window #26071
Comments
Triggered auto assignment to @puneetlath ( |
Bug0 Triage Checklist (Main S/O)
|
I don't understand. Why is the fact that it has to load when resizing a bug? |
ProposalPlease re-state the problem that we are trying to solve in this issue.image loads on reesize window What is the root cause of that problem?This issue causes by
App/src/components/Attachments/AttachmentCarousel/index.js Lines 125 to 141 in c7c538f
This function will mount and unmount the component when resize window. That mean call the App/src/components/Attachments/AttachmentCarousel/index.js Lines 152 to 164 in c7c538f
and I also found another problem when user resize faster it will cause crash application and show something went wrong page. This issue cause by App/src/components/withWindowDimensions.js Lines 44 to 62 in 2d29b58
In this logic you are listener the dimension change event and this event will call when the dimension change and re-render component and cause the issue ( What alternative solutions did you explore?Fixed 1 IssueMove this logic to out of the App/src/components/Attachments/AttachmentCarousel/index.js Lines 125 to 141 in c9a5f41
like this const AttachmentCarouselCellRenderer = memo((props) => {
const {windowWidth, isSmallScreenWidth} = useWindowDimensions();
const modalStyles = styles.centeredModalStyles(isSmallScreenWidth, true);
const style = [props.style, styles.h100, {width: PixelRatio.roundToNearestPixel(windowWidth - (modalStyles.marginHorizontal + modalStyles.borderWidth) * 2)}];
return (
<View
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
style={style}
/>
);
}); update the Flatlist line 215 to use new component CellRendererComponent={AttachmentCarouselCellRenderer} Fixed 2 IssueUpdate the withWindowDimensions logic to use lodash debounce like this const onDimensionChange = useCallback((newDimensions) => {
const {window} = newDimensions;
setWindowDimension({
windowHeight: window.height,
windowWidth: window.width,
});
}, []);
const onDimensionChangeDebounce = useCallback(lodashDebounce(onDimensionChange, 300), []);
useEffect(() => {
const dimensionsEventListener = Dimensions.addEventListener('change', onDimensionChangeDebounce);
return () => {
if (!dimensionsEventListener) {
return;
}
dimensionsEventListener.remove();
};
}, []); I have tested and no longer see the crash issue. |
I don't think this is a bug as I mentioned here, so I'm going to go ahead and close. But feel free to comment if you disagree and we can keep discussing. |
@puneetlath It's bug. You can take a look the code, it should only add style and not mount/unmount the component that mean kill the component and create new one. So, if you fix mount/unmount the component, the loading issue will be resolved because the image already loaded. And another thing, because the logic mount/unmount the component it causes crash application like this Screen.Recording.2023-08-29.at.07.25.04.mov |
Ok interesting. How do you suggest we solve it? |
Job added to Upwork: https://www.upwork.com/jobs/~0123a04480c44d1baf |
Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav ( |
This comment was marked as off-topic.
This comment was marked as off-topic.
@puneetlath @saalimzafar I found the root cause of the crash issue I mention above. This issue cause by App/src/components/withWindowDimensions.js Lines 44 to 62 in 2d29b58
In this logic you are listener the dimension change event and this event will call when the dimension change and re-render component and cause the issue ( |
@puneetlath @saalimzafar I have updated my proposal to fix 2 issue Proposal |
ProposalPlease re-state the problem that we are trying to solve in this issue.image loads on resize window What is the root cause of that problem?App/src/components/AttachmentModal.js Lines 362 to 369 in c20c387
The AttachmentView component re-renders when the AttachmentModal size changes. After re-rendering the AttachmentImageView as above, re-rendering the ImageView. When the ImageView re-renders, a loading spinner is displayed while loading the image with its URL. App/src/components/ImageView/index.js Line 32 in c20c387
App/src/components/ImageView/index.js Lines 89 to 99 in c20c387
App/src/components/ImageView/index.js Line 267 in c20c387
So when window size changes, loading spinner in ImageView is displayed. This is the root cause of this problem. What changes do you think we should make in order to solve the problem?I think we should include a prop telling whether to show the loading spinner or not. To implement it, I change the ImageView to:
function ImageView({isAuthTokenRequired, url, fileName, shouldDisplaySpinner})
{isLoading && shouldDisplaySpinner && <FullscreenLoadingIndicator style={[styles.opacity1, styles.bgTransparent]} />} |
📣 @kanno927! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Will review this today/tomorrow. |
🎀 👀 🎀 C+ reviewed. |
Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
@mananjadhav @puneetlath PR is ready #26543. Please help me review it. Thanks ❤️ |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.73-1 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-02. 🎊 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:
|
@mananjadhav friendly reminder on the checklist so we can pay this out in a couple days. Thanks! |
@mananjadhav another friendly bump on the checklist so that we can pay. |
@puneetlath it is eligible for $250 for reporting bonus because it was logged before 30 Aug |
The change was introduced in this PR and I've added a comment here. I don't think we need a regression test for this one. @puneetlath wdyt ? Also can you post the payout summary so that this can be paid out? |
Yes, I agree with you on that. |
Payment summary: $250 - @gadhiyamanan - bug report (paid via Upwork) @tamdao please let me know when you've accepted the Upwork offer. Thanks everyone! |
@puneetlath Accepted. Thanks |
Ok great. Just waiting for you to create a NewDot request @mananjadhav. Then we can close. |
@puneetlath I've created the request, we can close this one out. |
Great, thanks everyone! |
$1,000 payment approved for @mananjadhav based on BZ summary. |
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:
should not show loader on resize window
Actual Result:
loader appears on resize window
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.57-2
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-18.at.11.47.50.AM.mov
Recording.2995.mp4
Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692339507173639
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: