fix: Bug - Sending files and attachment issues
Hydrate playable media after disk receive, relay file-announce to sibling devices via account_sync, bind DM attachments to pre-allocated message ids, and improve gallery retry/cancel UX with bounded parallel auto-downloads. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import {
|
||||
getWatchedAttachmentRoomIdFromUrl,
|
||||
isAttachmentPendingMediaHydration,
|
||||
isDirectMessageAttachmentRoomId,
|
||||
isPlayableAttachmentMedia,
|
||||
shouldCopyUploaderMediaToAppData,
|
||||
shouldCopyLargeUploaderFileToAppData,
|
||||
shouldStreamAttachmentReceiveToDisk,
|
||||
@@ -83,6 +85,24 @@ describe('attachment logic', () => {
|
||||
}, capabilities)).toBe(true);
|
||||
});
|
||||
|
||||
it('identifies playable media pending hydration from disk paths', () => {
|
||||
expect(isPlayableAttachmentMedia({ mime: 'video/mp4' })).toBe(true);
|
||||
expect(isPlayableAttachmentMedia({ mime: 'image/png' })).toBe(false);
|
||||
|
||||
expect(isAttachmentPendingMediaHydration({
|
||||
mime: 'audio/mpeg',
|
||||
available: true,
|
||||
savedPath: '/data/song.mp3'
|
||||
})).toBe(true);
|
||||
|
||||
expect(isAttachmentPendingMediaHydration({
|
||||
mime: 'audio/mpeg',
|
||||
available: true,
|
||||
objectUrl: 'file:///data/song.mp3',
|
||||
savedPath: '/data/song.mp3'
|
||||
})).toBe(false);
|
||||
});
|
||||
|
||||
it('receives browser-sized files in memory when disk streaming is unavailable', () => {
|
||||
const browserCapabilities = {
|
||||
canStreamToDisk: false,
|
||||
|
||||
Reference in New Issue
Block a user