-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Merged
kodiakhq
merged 22 commits into
develop
from
SUP-769-Image-Upload-Display-Error-Message-on-Failure-Silent-Fail-for-Specific-JPEGs-ufs-VipsJpeg-errors
May 9, 2025
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
467c848
fix: image upload failing for specific jpegs
cardoso e35a9f2
Merge branch 'develop' into SUP-769-Image-Upload-Display-Error-Messag…
cardoso ef168d3
Merge branch 'develop' of https://github.com/RocketChat/Rocket.Chat i…
cardoso 1216317
Merge branch 'develop' of https://github.com/RocketChat/Rocket.Chat i…
cardoso ad646da
fix: display error indicator when image upload fails
cardoso 36c44ad
test: with and without Message_Attachments_Strip_Exif
cardoso 0fee022
Merge branch 'develop' into SUP-769-Image-Upload-Display-Error-Messag…
cardoso 86a7e82
chore: add changeset
cardoso 8545447
Merge branch 'develop' into SUP-769-Image-Upload-Display-Error-Messag…
cardoso ca4c75c
Merge branch 'develop' into SUP-769-Image-Upload-Display-Error-Messag…
cardoso a90d908
Merge branch 'develop' into SUP-769-Image-Upload-Display-Error-Messag…
cardoso 3d68509
Merge branch 'develop' into SUP-769-Image-Upload-Display-Error-Messag…
cardoso 5d41a4b
Merge branch 'develop' into SUP-769-Image-Upload-Display-Error-Messag…
cardoso ba30030
Merge branch 'develop' into SUP-769-Image-Upload-Display-Error-Messag…
cardoso 7c96888
fix: handle possible empty string
cardoso e3caef8
fix: handle possible empty string
cardoso eca914b
fix: handle error response for file upload in send function
cardoso 04c87e2
fix: UploadProgressIndicator a11y
dougfabris 525b023
test: updates image upload error selector
cardoso e26d291
fix: review
dougfabris f893616
Merge branch 'develop' into SUP-769-Image-Upload-Display-Error-Messag…
kodiakhq[bot] bff8ede
Merge branch 'develop' into SUP-769-Image-Upload-Display-Error-Messag…
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@rocket.chat/meteor": patch | ||
| --- | ||
|
|
||
| Fixes an issue where the upload of malformed images failed silently with Message_Attachments_Strip_Exif disabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import { Users } from './fixtures/userStates'; | ||
| import { HomeChannel } from './page-objects'; | ||
| import { createTargetChannel, getSettingValueById, setSettingValueById } from './utils'; | ||
| import { test, expect } from './utils/test'; | ||
|
|
||
| test.use({ storageState: Users.user1.state }); | ||
|
|
||
| test.describe('image-upload', () => { | ||
| let settingDefaultValue: unknown; | ||
| let poHomeChannel: HomeChannel; | ||
| let targetChannel: string; | ||
|
|
||
| test.beforeAll(async ({ api }) => { | ||
| settingDefaultValue = await getSettingValueById(api, 'Message_Attachments_Strip_Exif'); | ||
| targetChannel = await createTargetChannel(api, { members: ['user1'] }); | ||
| }); | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| poHomeChannel = new HomeChannel(page); | ||
| await page.goto('/home'); | ||
| await poHomeChannel.sidenav.openChat(targetChannel); | ||
| }); | ||
|
|
||
| test.afterAll(async ({ api }) => { | ||
| await setSettingValueById(api, 'Message_Attachments_Strip_Exif', settingDefaultValue); | ||
| expect((await api.post('/channels.delete', { roomName: targetChannel })).status()).toBe(200); | ||
| }); | ||
|
|
||
| test.describe('strip exif disabled', () => { | ||
| test.beforeAll(async ({ api }) => { | ||
| await setSettingValueById(api, 'Message_Attachments_Strip_Exif', false); | ||
| }); | ||
|
|
||
| test('should show error indicator when upload fails', async () => { | ||
| await poHomeChannel.content.sendFileMessage('bad-orientation.jpeg'); | ||
| await poHomeChannel.content.fileNameInput.fill('bad-orientation.jpeg'); | ||
| await poHomeChannel.content.descriptionInput.fill('bad-orientation_description'); | ||
| await poHomeChannel.content.btnModalConfirm.click(); | ||
|
|
||
| await expect(poHomeChannel.statusUploadIndicator).toContainText('Error:'); | ||
| }); | ||
| }); | ||
|
|
||
| test.describe('strip exif enabled', () => { | ||
| test.beforeAll(async ({ api }) => { | ||
| await setSettingValueById(api, 'Message_Attachments_Strip_Exif', true); | ||
| }); | ||
|
|
||
| test('should succeed upload of bad-orientation.jpeg', async () => { | ||
| await poHomeChannel.content.sendFileMessage('bad-orientation.jpeg'); | ||
| await poHomeChannel.content.fileNameInput.fill('bad-orientation.jpeg'); | ||
| await poHomeChannel.content.descriptionInput.fill('bad-orientation_description'); | ||
| await poHomeChannel.content.btnModalConfirm.click(); | ||
|
|
||
| await expect(poHomeChannel.content.getFileDescription).toHaveText('bad-orientation_description'); | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.