fix: Bug - Sending files and attachment issues
Normalize attachment MIME types from filenames, hydrate playable media and gallery tiles from disk without redundant peer requests, reset stalled partial downloads, and improve gallery retry/hydration UX across chat and DMs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { isImageAttachment } from './attachment-image.rules';
|
||||
import { resolveAttachmentMime } from './attachment-mime.rules';
|
||||
import type { AttachmentMeta } from '../models/attachment.model';
|
||||
|
||||
export function normalizeAttachmentMeta<T extends AttachmentMeta>(meta: T): T {
|
||||
const mime = resolveAttachmentMime(meta.filename, meta.mime);
|
||||
|
||||
return {
|
||||
...meta,
|
||||
mime,
|
||||
isImage: isImageAttachment({
|
||||
filename: meta.filename,
|
||||
isImage: meta.isImage,
|
||||
mime
|
||||
})
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user