fix: Bug - Sending files and attachment issues (gallery load and speed)
Route small images through in-memory receive instead of serialized disk chunk-acks, and improve gallery hydration for local copies and pending downloads so thumbnails display without minutes-long progress stalls. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+15
-1
@@ -4,7 +4,7 @@ import {
|
||||
it
|
||||
} from 'vitest';
|
||||
|
||||
import { buildChatMessageGalleryTiles } from './chat-message-image-gallery.rules';
|
||||
import { buildChatMessageGalleryTiles, resolveChatMessageGalleryTileState } from './chat-message-image-gallery.rules';
|
||||
|
||||
describe('buildChatMessageGalleryTiles', () => {
|
||||
it('marks displayable, hydrating, downloading, and retry tiles from attachment state', () => {
|
||||
@@ -51,4 +51,18 @@ describe('buildChatMessageGalleryTiles', () => {
|
||||
'retry'
|
||||
]);
|
||||
});
|
||||
|
||||
it('treats zero-byte pending requests as downloading instead of retry', () => {
|
||||
const attachment = {
|
||||
id: 'pending',
|
||||
filename: 'waiting.png',
|
||||
mime: 'image/png',
|
||||
isImage: true,
|
||||
available: false,
|
||||
size: 256
|
||||
};
|
||||
|
||||
expect(resolveChatMessageGalleryTileState(attachment)).toBe('retry');
|
||||
expect(resolveChatMessageGalleryTileState(attachment, { pendingRequest: true })).toBe('downloading');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user