You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-10-02] [$1000] image loads on reesize window #26071
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?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
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
This function will mount and unmount the component when resize window. That mean call the renderItem function render the new item component, that why you see the loading state
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 (Maximum update depth) when user re-size window multiple time.
What alternative solutions did you explore?
Fixed 1 Issue
Move this logic to out of the AttachmentCarousel component and use memo
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
Activity
melvin-bot commentedon Aug 28, 2023
Triggered auto assignment to @puneetlath (
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 ✅)puneetlath commentedon Aug 28, 2023
I don't understand. Why is the fact that it has to load when resizing a bug?
tamdao commentedon Aug 28, 2023
Proposal
Please 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
CellRendererComponentof FlatlistApp/src/components/Attachments/AttachmentCarousel/index.js
Line 215 in c7c538f
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
renderItemfunction render the new item component, that why you see the loading stateApp/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
withWindowDimensionsfunctionApp/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 (
Maximum update depth) when user re-size window multiple time.What alternative solutions did you explore?
Fixed 1 Issue
Move this logic to out of the
AttachmentCarouselcomponent and use memoApp/src/components/Attachments/AttachmentCarousel/index.js
Lines 125 to 141 in c9a5f41
like this
update the Flatlist line 215 to use new component
Fixed 2 Issue
Update the withWindowDimensions logic to use lodash debounce like this
I have tested and no longer see the crash issue.
puneetlath commentedon Aug 28, 2023
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.
tamdao commentedon Aug 29, 2023
@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
puneetlath commentedon Aug 29, 2023
Ok interesting. How do you suggest we solve it?
[-] image loads on reesize window[/-][+][$1000] image loads on reesize window[/+]melvin-bot commentedon Aug 29, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0123a04480c44d1baf
36 remaining items
puneetlath commentedon Oct 2, 2023
@mananjadhav another friendly bump on the checklist so that we can pay.
gadhiyamanan commentedon Oct 2, 2023
@puneetlath it is eligible for $250 for reporting bonus because it was logged before 30 Aug
simplify AttachmentCarousel logic
mananjadhav commentedon Oct 2, 2023
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?
puneetlath commentedon Oct 2, 2023
Yes, I agree with you on that.
puneetlath commentedon Oct 2, 2023
Payment summary:
$250 - @gadhiyamanan - bug report (paid via Upwork)
$1000 - @tamdao - contributor (paid via Upwork)
$1000 - @mananjadhav - C+ (to be paid via NewDot)
@tamdao please let me know when you've accepted the Upwork offer.
@mananjadhav let me know when you've created the request on NewDot.
Thanks everyone!
tamdao commentedon Oct 2, 2023
@puneetlath Accepted. Thanks
puneetlath commentedon Oct 3, 2023
Ok great. Just waiting for you to create a NewDot request @mananjadhav. Then we can close.
mananjadhav commentedon Oct 4, 2023
@puneetlath I've created the request, we can close this one out.
puneetlath commentedon Oct 5, 2023
Great, thanks everyone!
JmillsExpensify commentedon Oct 5, 2023
$1,000 payment approved for @mananjadhav based on BZ summary.