Skip to content
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

Closed
1 of 6 tasks
lanitochka17 opened this issue Oct 1, 2024 · 30 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 1, 2024

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:

  1. Navigate to any chat
  2. Send an image markdown that has a URL that points to no image. (You can find the url in the attached text file)
  3. Click on the image preview from chat history

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?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

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
  • Upwork Job URL: https://www.upwork.com/jobs/~021844118961553330610
  • Upwork Job ID: 1844118961553330610
  • Last Price Increase: 2024-10-09
  • Automatic offers:
    • suneox | Reviewer | 104435699
    • huult | Contributor | 104435700
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 1, 2024
Copy link

melvin-bot bot commented Oct 1, 2024

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@lanitochka17
Copy link
Author

@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

@lanitochka17
Copy link
Author

We think that this bug might be related to #Live Markdown

@huult
Copy link
Contributor

huult commented Oct 1, 2024

Edited by proposal-police: This proposal was edited at 2023-10-05T12:00:00Z.

Proposal

Please 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.

if (failedToLoad || previewSourceURL === '') {

and it keeps loading forever because onLoad does not call back to set setIsLoading to false due to the image load error

{isLoading && (!isOffline || isLocalFile) && <FullscreenLoadingIndicator style={[styles.opacity1, styles.bgTransparent]} />}

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:

  1. Export onLoadFailure to props
// .src/components/ThumbnailImage.tsx#L65
  function ThumbnailImage({
    ...
+ onLoadFailure,

// .src/components/ThumbnailImage.tsx#L141
 <ImageWithSizeCalculation
    ...
- onLoadFailure={() => setFailedToLoad(true)}
+      onLoadFailure={() => {
+                        setFailedToLoad(true);
+                        onLoadFailure?.(true);
+                    }}    
  1. Handle image load errors in ImageRender.
// 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

@melvin-bot melvin-bot bot added the Overdue label Oct 3, 2024
Copy link

melvin-bot bot commented Oct 4, 2024

@JmillsExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Oct 8, 2024

@JmillsExpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@JmillsExpensify JmillsExpensify added the External Added to denote the issue can be worked on by a contributor label Oct 9, 2024
Copy link

melvin-bot bot commented Oct 9, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021844118961553330610

@melvin-bot melvin-bot bot changed the title Live MD - Gray placeholder image is displayed when sending markdown image with wrong url [$250] Live MD - Gray placeholder image is displayed when sending markdown image with wrong url Oct 9, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 9, 2024
@JmillsExpensify
Copy link

Opened up for proposal review.

Copy link

melvin-bot bot commented Oct 9, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @suneox (External)

@melvin-bot melvin-bot bot removed the Overdue label Oct 9, 2024
@suneox
Copy link
Contributor

suneox commented Oct 11, 2024

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?
Screenshot 2024-10-12 at 00 57 55

@JmillsExpensify Could you please provide an error message for this scenario?

@dannymcclain
Copy link
Contributor

I wonder if we could just display a broken image placeholder like this?

CleanShot 2024-10-11 at 13 41 39@2x

Is the error message actually going to be helpful at all? I'm just wondering if we really need to display a message at all.

@suneox
Copy link
Contributor

suneox commented Oct 12, 2024

I wonder if we could just display a broken image placeholder like this?

CleanShot 2024-10-11 at 13 41 39@2x

Is the error message actually going to be helpful at all? I'm just wondering if we really need to display a message at all.

Yeah, If we display a broken image, I think we can skip showing an error message.

@dannymcclain
Copy link
Contributor

Sounds good to me. I think that's a solid approach. cc @Expensify/design for a gut check though.

@melvin-bot melvin-bot bot added the Overdue label Oct 14, 2024
@shawnborton
Copy link
Contributor

I agree with that, it feels cleaner to just show the broken image with no message.

@dubielzyk-expensify
Copy link
Contributor

+1 to what @dannymcclain suggested 👍

@suneox
Copy link
Contributor

suneox commented Oct 15, 2024

We can proceed with @huult proposal to show a broken image and prevent open an image when it fails to load.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 15, 2024

Triggered auto assignment to @MarioExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

Copy link

melvin-bot bot commented Oct 15, 2024

@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!

@MarioExpensify
Copy link
Contributor

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 15, 2024
Copy link

melvin-bot bot commented Oct 15, 2024

📣 @suneox 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Oct 15, 2024

📣 @huult 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@huult
Copy link
Contributor

huult commented Oct 16, 2024

Thank you, everyone. I will create the PR within 24 hours.

@huult
Copy link
Contributor

huult commented Oct 16, 2024

@dannymcclain I couldn't find this image in the source code. Could you please send it to me?

@dannymcclain
Copy link
Contributor

It probably hasn't made it's way into the repo yet. Here it is:

Image Slash.svg.zip

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 16, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 23, 2024
@melvin-bot melvin-bot bot changed the title [$250] Live MD - Gray placeholder image is displayed when sending markdown image with wrong url [HOLD for payment 2024-10-30] [$250] Live MD - Gray placeholder image is displayed when sending markdown image with wrong url Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

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:

Copy link

melvin-bot bot commented Oct 23, 2024

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:

  • [@suneox] The PR that introduced the bug has been identified. Link to the PR:
  • [@suneox] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@suneox] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@suneox] Determine if we should create a regression test for this bug.
  • [@suneox] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@suneox
Copy link
Contributor

suneox commented Oct 27, 2024

Checklist

  • [@suneox] The PR that introduced the bug has been identified. Link to the PR: N/A
  • [@suneox] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. There isn’t an offending PR in this case, as this is part of a new UI implementation
  • [@suneox] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
  • [@suneox] Determine if we should create a regression test for this bug: N/A
  • [@suneox] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. N/A

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 29, 2024
@JmillsExpensify
Copy link

Payment summary:

  • Contributor: $250 @huult via Upwork
  • Reviewer: $250 @suneox via Upwork

@JmillsExpensify
Copy link

All contributors paid out. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants