-
Notifications
You must be signed in to change notification settings - Fork 13.8k
fix: audio attachments cannot be seeked using the progress slider #41588
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
dionisio-bot
merged 3 commits into
release-8.7.0
from
regression/audio-attachment-seek-broken
Jul 31, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 audio attachments not being seekable using the progress slider |
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
63 changes: 63 additions & 0 deletions
63
apps/meteor/server/lib/media/file-upload/lib/ranges.spec.ts
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,63 @@ | ||
| import type http from 'node:http'; | ||
|
|
||
| import type { IUpload } from '@rocket.chat/core-typings'; | ||
| import { expect } from 'chai'; | ||
| import { describe, it } from 'mocha'; | ||
|
|
||
| import { getFileRange } from './ranges'; | ||
|
|
||
| const req = (range?: string) => ({ headers: { range } }) as http.IncomingMessage; | ||
| const file = (size: number) => ({ size }) as IUpload; | ||
|
|
||
| describe('getFileRange', () => { | ||
| it('returns undefined when no Range header is present', () => { | ||
| expect(getFileRange(file(1000), req())).to.equal(undefined); | ||
| }); | ||
|
|
||
| it('returns undefined for a malformed Range header', () => { | ||
| expect(getFileRange(file(1000), req('bytes=abc'))).to.equal(undefined); | ||
| expect(getFileRange(file(1000), req('items=0-99'))).to.equal(undefined); | ||
| expect(getFileRange(file(1000), req('bytes=-'))).to.equal(undefined); | ||
| }); | ||
|
|
||
| it('returns undefined when the file has no size', () => { | ||
| expect(getFileRange(file(0), req('bytes=0-'))).to.equal(undefined); | ||
| }); | ||
|
|
||
| it('serves an open-ended range `bytes=0-` as the whole file', () => { | ||
| expect(getFileRange(file(1000), req('bytes=0-'))).to.deep.equal({ outOfRange: false, start: 0, stop: 999 }); | ||
| }); | ||
|
|
||
| it('serves an open-ended range from a mid-file offset to EOF', () => { | ||
| expect(getFileRange(file(1000), req('bytes=77-'))).to.deep.equal({ outOfRange: false, start: 77, stop: 999 }); | ||
| }); | ||
|
|
||
| it('serves an explicit closed range', () => { | ||
| expect(getFileRange(file(1000), req('bytes=100-199'))).to.deep.equal({ outOfRange: false, start: 100, stop: 199 }); | ||
| }); | ||
|
|
||
| it('clamps an end that runs past EOF', () => { | ||
| expect(getFileRange(file(1000), req('bytes=100-5000'))).to.deep.equal({ outOfRange: false, start: 100, stop: 999 }); | ||
| }); | ||
|
|
||
| it('serves a suffix range `bytes=-N` as the last N bytes', () => { | ||
| expect(getFileRange(file(1000), req('bytes=-200'))).to.deep.equal({ outOfRange: false, start: 800, stop: 999 }); | ||
| }); | ||
|
|
||
| it('clamps a suffix range larger than the file to the whole file', () => { | ||
| expect(getFileRange(file(1000), req('bytes=-5000'))).to.deep.equal({ outOfRange: false, start: 0, stop: 999 }); | ||
| }); | ||
|
|
||
| it('flags a start at or beyond EOF as out of range', () => { | ||
| expect(getFileRange(file(1000), req('bytes=1000-'))).to.deep.equal({ outOfRange: true, start: 1000, stop: 999 }); | ||
| expect(getFileRange(file(1000), req('bytes=1500-1600'))).to.deep.equal({ outOfRange: true, start: 1500, stop: 999 }); | ||
| }); | ||
|
|
||
| it('flags an inverted closed range as out of range', () => { | ||
| expect(getFileRange(file(1000), req('bytes=200-100'))).to.deep.equal({ outOfRange: true, start: 200, stop: 100 }); | ||
| }); | ||
|
|
||
| it('serves the final byte of the file', () => { | ||
| expect(getFileRange(file(1000), req('bytes=999-'))).to.deep.equal({ outOfRange: false, start: 999, stop: 999 }); | ||
| }); | ||
| }); | ||
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.