mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-10 16:23:44 +00:00
Two gaps in the referenced-file-id capping: The file_id branch matched File rows with no ownership check, and file ids inside message/conversation documents are caller-supplied (saveMessage spreads request params into the update). A crafted or imported message referencing another user's file_id would therefore set that user's File.expiredAt during a forced-retention cascade or migration, and the storage sweeper would later delete their object. The referenced-id branch now always filters on File.user (dropped entirely when the caller's user id is not a castable ObjectId string — fail closed), in both capConversationFiles and the bulk tag/project scope. The conversationId branch stays unscoped: those rows are server-created by the conversation's own processes, and an id collision can only shorten the colliding owner's files. Assistants conversations persist thread uploads on Conversation.file_ids (saveUserMessage/syncMessages), which the parent projections never read, so files stored only there kept expiredAt: null after conversion. A shared conversationSeedFileIds helper now seeds the id collection from both files and file_ids across the cascade, saveConvo, the bulk cascade, and both sweep passes. |
||
|---|---|---|
| .. | ||
| api | ||
| client | ||
| data-provider | ||
| data-schemas | ||