6326: fix bug reported at #6518#6535
Conversation
deetergp
left a comment
There was a problem hiding this comment.
Code looks good, but I had a couple comments regarding comments.
src/components/ImageView/index.js
Outdated
| imgRight = imgLeft + (fitRate * width); | ||
| } | ||
|
|
||
| //In case image loading is delayed than onLayout callback of the root View caused internet speed |
There was a problem hiding this comment.
This comment isn't exactly clear. Is it still relevant/needed?
There was a problem hiding this comment.
Actually, my internet speed is not good sometimes. And I noticed that it has some issue because we would not load image correctly.
If you don't need this, I will remove.
src/styles/styles.js
Outdated
|
|
||
| // Return different size and offset style based on zoomScale and isZoom | ||
| if (isZoomed) { | ||
| if (zoomScale > 1) { |
There was a problem hiding this comment.
Would you please note what's going on in the UI in each of these cases?
There was a problem hiding this comment.
I added the comments for each styling logic.
And noticed that my styling was not correct in the previous commit.
So, fixed it too. (when isZoom === false && zoomScale < 1)
Please review and let me know if something is still not clear.
Thank you
|
Approved, but it looks like you've got a couple merge conflicts to resolve. |
|
|
Oh.. sorry |
Hi, @deetergp |
87eac47 to
2167b00
Compare
# Conflicts: # src/components/ImageView/index.js # src/styles/styles.js
|
Hi, @deetergp |
parasharrajat
left a comment
There was a problem hiding this comment.
Could you please follow the template for the PR?
$ Original Issue
$ Regression Issue
Revert these to how they should be.
src/components/ImageView/index.js
Outdated
| this.setState({ | ||
| imgWidth: width, imgHeight: height, imageLeft: imgLeft, imageTop: imgTop, imageRight: imgRight, imageBottom: imgBottom, | ||
| }); | ||
| // In case image loading is delayed than onLayout callback of the root View caused internet speed. |
There was a problem hiding this comment.
I didn't really understand what this comment is about?
There was a problem hiding this comment.
For regression, there is new issue that is open.
Because I didn't know which issue number should be written, so I made it.
Which issue number should be written?
Original one?
There was a problem hiding this comment.
For this comment, I noticed that image loading is delayed because of internet speed.
In this case, image size is not decided even though the container (modal) is open.
Because of this reason, zoomScale is also not decided.
To avoid this problem, I wrote the code and comment like above.
There was a problem hiding this comment.
onLayout callback of the root View caused internet speed.
this is not making sense to me. Could you please update it?
Please mention both issue URLs in the description.
There was a problem hiding this comment.
It means
1: You don't need such exception handling? Need to remove that code?
2. Should not write as Original issue, Regression issue?
Instead of it, should write urls directly like below?
https://github.com/Expensify/App/issues/6326, https://github.com/Expensify/App/issues/6518
There was a problem hiding this comment.
Hi, @parasharrajat
Could you please let me know what you expect exactly?
There was a problem hiding this comment.
I will let others review it. I don't really know this part of code.
There was a problem hiding this comment.
If you want, I can remove that code shortly.
But I added that code because I noticed the issue in my side.
Please let me know whenever you have any feedback.
There was a problem hiding this comment.
Hi, @parasharrajat , @deetergp
How are you doing?
Any feedback from other reviewers?
Please kindly let me know so that we can proceed.
Thank you
There was a problem hiding this comment.
I tried hard to understand what you were trying to communicate with this comment, but it doesn't make sense to me. It sounds like there's some race condition at play here? If you can explain what you mean in a different way, that would be great. Otherwise, please just remove this comment.
|
I am not familiar with this part of code thus I would not be able to properly review it. I am also not assigned to this issue. Please continue without my review. I would recommend to get more eyes on this PR as there could be more regressions. |
@parasharrajat
@deetergp |
|
@roryabraham |
|
Hi @railway17. I'm going to review this – this is time-sensitive so let's work together to get this merged ASAP. |
Ok, here is 1:00am now, but I will try to work with you together. |
roryabraham
left a comment
There was a problem hiding this comment.
Also, what if the window resizes? I think maybe we need to handle this by:
- Saving the image height as a class field before calling
setImageRegion - Calling
setImageRegionagain incomponentDidUpdateif the window dimensions changed.
| const newZoomScale = Math.min(this.state.containerWidth / width, this.state.containerHeight / height); | ||
| this.setState(prevState => ({ | ||
| imgWidth: width, | ||
| zoomScale: prevState.zoomScale === 0 ? newZoomScale : prevState.zoomScale, |
There was a problem hiding this comment.
Why not just use the newZoomScale in all cases?
There was a problem hiding this comment.
Actually, I was going to set zoomScale in the onLayout event of the parent view.
But while testing in my local, I noticed that it is sometimes 0 because image loading is slower than view loading.
So, reset with newZoomScale here.
src/components/ImageView/index.js
Outdated
| this.setState({ | ||
| imgWidth: width, imgHeight: height, imageLeft: imgLeft, imageTop: imgTop, imageRight: imgRight, imageBottom: imgBottom, | ||
| }); | ||
| // In case image loading is delayed than onLayout callback of the root View caused internet speed. |
There was a problem hiding this comment.
I tried hard to understand what you were trying to communicate with this comment, but it doesn't make sense to me. It sounds like there's some race condition at play here? If you can explain what you mean in a different way, that would be great. Otherwise, please just remove this comment.
|
@railway17 It's okay – what I'm going to do instead is revert your original PR and that way we can take the time we need to re-implement it without causing a regression. |
I removed the comment from that code and pushed it. |
Okay, I had a couple more comments in my last review |
|
roryabraham
left a comment
There was a problem hiding this comment.
Okay, I'm going to approve and CP this to unblock the deploy, but will follow up with a small PR of my own to address my comments.
|
CP'ing to unblock deploys. |
|
@roryabraham looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
|
|
(cherry picked from commit d445fda)
|
Not an emergency, just CP'ing to speed up deploys. Only change since last successful E2E test was the removal of a comment. |
|
🚀 Deployed to staging by @roryabraham in version: 1.1.17-8 🚀
|
|
🚀 Deployed to production by @roryabraham in version: 1.1.18-3 🚀
|
|
We have found another regression from this PR. @railway17 cc: @roryabraham |
Details
Regress bugs that are displayed when testing with very long or wide images
Fixed Issues
$ Original Issue
$ Regression Issue
Tests
QA Steps
Tested On
Screenshots
Web
Web Regression Video
Desktop
Desktop Regression Video