Skip to content

fix: upload of malformed jpegs with Message_Attachments_Strip_Exif disabled fails silently #35839

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

Conversation

cardoso
Copy link
Member

@cardoso cardoso commented Apr 17, 2025

Proposed changes (including videos or screenshots)

Issue(s)

SUP-769

Steps to test or reproduce

Further comments


Description

This pull request addresses an issue in the Rocket.Chat repository where image uploads were failing for specific JPEG files. The problem only occurs when Message_Attachments_Strip_Exif is set to false (current default is true). Some of the upload logic which uses xhr also needed tweaking, and the frontend side needed to display the error.

Copy link
Contributor

dionisio-bot bot commented Apr 17, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented Apr 17, 2025

🦋 Changeset detected

Latest commit: bff8ede

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 36 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

kodus-ai bot commented Apr 17, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

Copy link
Contributor

github-actions bot commented Apr 17, 2025

PR Preview Action v1.6.1

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-35839/

Built to branch gh-pages at 2025-05-09 02:14 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link

codecov bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.77%. Comparing base (04e7530) to head (bff8ede).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #35839      +/-   ##
===========================================
+ Coverage    64.62%   64.77%   +0.15%     
===========================================
  Files         3244     3093     -151     
  Lines        95388    92144    -3244     
  Branches     17851    17517     -334     
===========================================
- Hits         61643    59689    -1954     
+ Misses       30849    29703    -1146     
+ Partials      2896     2752     -144     
Flag Coverage Δ
e2e 58.11% <100.00%> (+0.03%) ⬆️
unit 71.93% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cardoso
Copy link
Member Author

cardoso commented Apr 17, 2025

May be worth looking into sharp 0.34: lovell/sharp#3947 (comment)

cardoso added 5 commits April 20, 2025 15:57
…e-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
…nto SUP-769-Image-Upload-Display-Error-Message-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
…nto SUP-769-Image-Upload-Display-Error-Message-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
@cardoso cardoso marked this pull request as ready for review April 22, 2025 23:20
@cardoso cardoso requested a review from a team as a code owner April 22, 2025 23:20
@cardoso cardoso changed the title fix: image upload failing for specific jpegs fix: upload of malformed jpegs with Message_Attachments_Strip_Exif disabled fails silently Apr 22, 2025
@cardoso
Copy link
Member Author

cardoso commented Apr 22, 2025

@kody start-review

…e-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
@cardoso cardoso added this to the 7.7.0 milestone Apr 24, 2025
Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't forget to add a changeset

cardoso added 2 commits April 24, 2025 16:47
…e-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
cardoso added 3 commits April 25, 2025 14:38
…e-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
…e-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
…e-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
…e-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
Copy link
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

MarcosSpessatto
MarcosSpessatto previously approved these changes May 8, 2025
Changes the selector for identifying image upload errors.

This avoids relying on specific text content and improves the
robustness of the test.
@cardoso cardoso requested a review from dougfabris May 8, 2025 15:45
Copy link
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dougfabris dougfabris requested a review from MarcosSpessatto May 8, 2025 16:13
@scuciatto scuciatto added the stat: QA assured Means it has been tested and approved by a company insider label May 9, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label May 9, 2025
kodiakhq bot added 2 commits May 9, 2025 01:53
…e-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
…e-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
@kodiakhq kodiakhq bot merged commit 1a1fe46 into develop May 9, 2025
48 checks passed
@kodiakhq kodiakhq bot deleted the SUP-769-Image-Upload-Display-Error-Message-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors branch May 9, 2025 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants