Skip to content

[$1000] Attachment - No feedback or error message when choosing invalid image file to be sent on chat #19728

Closed

Description

@kbecciv

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open the Expensify app on the web browser
  2. Go to any chat conversation
  3. Click on the "+" icon(actions button) of the chat
  4. Click on Add attachment
  5. Select an invalid or corrupted image file from the file explorer(you can create invalid image file by changing any .txt or .pdf file to .jpg simply or you can find sample invalid image attached in thread)
  6. Observe the infinite loading

Expected Result:

The app should display a feedback or error message indicating that the file is not valid or just upload and send as a file without trying to display preview(if the image file is invalid)

Actual Result:

The app does not show any feedback or error message and tries to preview the image file with infinite loading

Workaround:

Unknown

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

Reproducible in staging?: yes

Reproducible in production?: yes

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

no.feedback.mp4
Recording.2865.mp4

Expensify/Expensify Issue URL:

Issue reported by: @KALLL

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1685001824882209

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01764cde9077e5564b
  • Upwork Job ID: 1664297284350144512
  • Last Price Increase: 2023-07-14

Activity

  1. added
    Daily
    Bug
    on May 28, 2023
  2. melvin-bot commented on May 28, 2023

    @melvin-bot

    Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. melvin-bot commented on May 28, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. allroundexperts commented on May 28, 2023

    @allroundexperts
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    For corrupt files, we're showing an infinite loader in the Attachment View.

    What is the root cause of that problem?

    The root cause of this issue is that we're not validating the file types correctly (based on the magic headers, more about this approach in the alternate section). This causes corrupt files to go through to the AttachmentView component. Further more, in the ImageView component, we're also not using the onError callback like we're using on the PDFView component.

    What changes do you think we should make in order to solve the problem?

    The simplest solution (without magic header check) is to add a onError handler to the ImageView component here. I'm not sure how the UI should look like exactly once error is encountered but we can keep the error in state and if its true, we can render a message here.

    What alternative solutions did you explore? (Optional)

    The real solution for this sort of issue IMO is to check the file type based on magic headers of the file instead of relying on the file type extracted from the name. The code for this was added in this PR some time ago but the team decided not to add frontend validation of files until another issue came up.

    For reference, here's how Slack deals with a jpg extension file that is actually a text file:
    https://github.com/Expensify/App/assets/30054992/bffbd3ed-6d9e-4d85-a06c-001ad31050f4

  5. added
    External
    on Jun 1, 2023
  6. changed the title [-]Attachment - No feedback or error message when choosing invalid image file to be sent on chat[/-] [+][$1000] Attachment - No feedback or error message when choosing invalid image file to be sent on chat[/+] on Jun 1, 2023
  7. melvin-bot commented on Jun 1, 2023

    @melvin-bot
  8. melvin-bot commented on Jun 1, 2023

    @melvin-bot

    Current assignee @sonialiap is eligible for the External assigner, not assigning anyone new.

  9. melvin-bot commented on Jun 1, 2023

    @melvin-bot

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

  10. added
    Help Wanted
    on Jun 1, 2023
  11. melvin-bot commented on Jun 1, 2023

    @melvin-bot

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

  12. 162 remaining items

  13. added
    Weekly
    and removed
    Daily
    on Dec 14, 2023
  14. melvin-bot commented on Jan 8, 2024

    @melvin-bot

    This issue has not been updated in over 15 days. @youssef-lr, @sonialiap, @aimane-chnaif eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  15. melvin-bot commented on Mar 5, 2024

    @melvin-bot

    @youssef-lr, @sonialiap, @aimane-chnaif, this Monthly task hasn't been acted upon in 6 weeks; closing.

    If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

  16. mallenexpensify commented on Nov 11, 2025

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @aimane-chnaif paid $500 via Upwork.

  17. KALLL commented on Nov 12, 2025

    @KALLL

    @aimane-chnaif @kbecciv @sonialiap @mallenexpensify @MariaHCD Glad to see this issue resolved. I reported this issue, I am waiting to be paid as the issue reporter, thanks for your consideration.

  18. aimane-chnaif commented on Nov 12, 2025

    @aimane-chnaif
    Contributor

    @KALLL We ended up not fixing as not a priority

  19. KALLL commented on Nov 12, 2025

    @KALLL

    @aimane-chnaif Ohh sorry, I thought it is resolved when I see the payment summary above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugEngineeringInternalMonthlyNot a priorityReviewing

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions