fix(core): handle group file storage limits

Retry eligible storage failures as temporary files and preserve their storage type for later use. Reject incompatible mixed content before chat publication.

Refs #644
This commit is contained in:
DrSmoothl committed 2026-11-07 15:14:55 +08:00
1 parent 84f4cde85e
commit 8bea681aa2
16 files changed
+750 -104

No files matched your search

+2 -17
View File
@@ -17,6 +17,8 @@ import type { OnlineDeviceInfo } from '@snowluma/protocol/events';
import { buildApiHub, type ApiHub } from './apis';
import { AiVoiceChatType, type AiVoiceCategory, type StrangerStatus } from './apis/extras';
import type { BridgeInterface, RosterWarmupResult } from './bridge-interface';
import type { UploadedFileMeta } from './bridge-context';
export type { UploadedFileMeta } from './bridge-context';
const log = createLogger('Bridge');
const runtimeLog = createLogger('Bridge.Runtime');
@@ -594,23 +596,6 @@ export interface SendMessageReceipt {
timestamp: number;
}
export interface UploadedFileMeta {
fileId: string;
scope: 'group' | 'private';
/** Group id if scope='group', else `undefined`. */
groupId?: number;
/** Friend uin if scope='private', else `undefined`. */
userId?: number;
fileName: string;
fileSize: number;
fileMd5: Uint8Array;
fileSha1: Uint8Array;
/** Server-issued hash returned alongside the upload (private only). */
fileHash?: string;
/** Insert time — used to evict the oldest entry when the cache fills. */
rememberedAt: number;
}
export interface DownloadRKeyInfo {
rkey: string;
ttlSeconds: number;