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:
2026-06-14 13:05:23 +02:00
co-authored by Cursor
parent bb0ac930ad
commit fa45052432
30 changed files with 785 additions and 71 deletions
@@ -0,0 +1,54 @@
import {
describe,
expect,
it
} from 'vitest';
import { buildChatMessageGalleryTiles } from './chat-message-image-gallery.rules';
describe('buildChatMessageGalleryTiles', () => {
it('marks displayable, hydrating, downloading, and retry tiles from attachment state', () => {
const tiles = buildChatMessageGalleryTiles([
{
id: 'displayable',
filename: 'ready.png',
mime: 'image/png',
isImage: true,
available: true,
objectUrl: 'blob:http://localhost/ready'
},
{
id: 'hydrating',
filename: 'saved.png',
mime: 'image/png',
isImage: true,
available: false,
savedPath: '/appdata/saved.png'
},
{
id: 'partial',
filename: 'partial.png',
mime: 'image/png',
isImage: true,
available: false,
receivedBytes: 128,
size: 512
},
{
id: 'retry',
filename: 'failed.png',
mime: 'image/png',
isImage: true,
available: false,
size: 256
}
]);
expect(tiles.map((tile) => tile.state)).toEqual([
'displayable',
'hydrating',
'downloading',
'retry'
]);
});
});