-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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-10-30] [$250] Live MD - Gray placeholder image is displayed when sending markdown image with wrong url #49992
Comments
Triggered auto assignment to @JmillsExpensify ( |
@JmillsExpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
We think that this bug might be related to #Live Markdown |
Edited by proposal-police: This proposal was edited at 2023-10-05T12:00:00Z. ProposalPlease re-state the problem that we are trying to solve in this issue.Gray placeholder image is displayed when sending markdown image with wrong url What is the root cause of that problem?As per the current logic, we only handle the thumbnail image by displaying a gray placeholder when the image fails to load. App/src/components/ThumbnailImage.tsx Line 117 in 7f0bdf0
and it keeps loading forever because onLoad does not call back to set setIsLoading to false due to the image load error App/src/components/ImageView/index.tsx Line 240 in a34ef87
What changes do you think we should make in order to solve the problem?We should update the error handling to match the expectations outlined in this ticket, like this:
// .src/components/ThumbnailImage.tsx#L65
function ThumbnailImage({
...
+ onLoadFailure,
// .src/components/ThumbnailImage.tsx#L141
<ImageWithSizeCalculation
...
- onLoadFailure={() => setFailedToLoad(true)}
+ onLoadFailure={() => {
+ setFailedToLoad(true);
+ onLoadFailure?.(true);
+ }}
// src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx#L68
+ const [isFailedToLoad, setIsFailedToLoad] = useState(false);
+ const {isOffline} = useNetwork();
<ThumbnailImage
...
+ onLoadFailure={(failedToLoad) => {
+ setIsFailedToLoad(failedToLoad);
+ }}
// src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx#L86
<PressableWithoutFocus
...
+ disabled={!isOffline && isFailedToLoad}
// src/components/HTMLEngineProvider/HTMLRenderers/ImageRenderer.tsx#L107
+ {!isOffline && isFailedToLoad && (
+ <View style={[styles.borderColorDanger]}>
+ <Text style={[styles.textDanger, styles.mt2]}>Failed to load the image. Please try again later.</Text>
+ </View>
+ )} or a broken image placeholder will be displayed if the image fails to load POC
Screen.Recording.2024-10-01.at.23.02.42.mov |
@JmillsExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@JmillsExpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
Job added to Upwork: https://www.upwork.com/jobs/~021844118961553330610 |
Opened up for proposal review. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @suneox ( |
The proposal from @huult to handle showing the error and disabling the image modal LGTM, but we need to confirm the display of the error and the error message content in this case. @Expensify/design Can we display an error below the image like this, or do we need a different design for this? @JmillsExpensify Could you please provide an error message for this scenario? |
Sounds good to me. I think that's a solid approach. cc @Expensify/design for a gut check though. |
I agree with that, it feels cleaner to just show the broken image with no message. |
+1 to what @dannymcclain suggested 👍 |
Triggered auto assignment to @MarioExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@JmillsExpensify @suneox @MarioExpensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
Assigning this to @huult , just make sure to adhere to the proposal of displaying a "broken image" and we should be good to go! Thank you @suneox |
📣 @suneox 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @huult 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Thank you, everyone. I will create the PR within 24 hours. |
@dannymcclain I couldn't find this image in the source code. Could you please send it to me? |
It probably hasn't made it's way into the repo yet. Here it is: |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.52-5 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-10-30. 🎊 For reference, here are some details about the assignees on this 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:
|
Checklist
|
All contributors paid out. Closing. |
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: 9.0.42-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: N/A
**Email or phone of affected tester (no customers):**[email protected]
Issue reported by: Applause - Internal Team
Issue found when executing PR #49250
Action Performed:
Expected Result:
Failed to load error message should be displayed in chat history
And user shouldn't be able to open the image in carousel
Actual Result:
Gray blank image is displayed
And there is infinite loading when opening the image
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6620919_1727773243522.Screen_Recording_2024-10-01_at_11.59.53_in_the_morning.mp4
txt.txt
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @JmillsExpensifyThe text was updated successfully, but these errors were encountered: