mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
⚙️ fix: Plugin Message Handling Errors (#3392)
- Add unique index for messageId and user in messageSchema - use `updateMessage` for updating the plugins message? - add better logging for updateMessage - prevents dupe_key or getKeyIndex error
This commit is contained in:
parent
ee4dd1b2e9
commit
9e7615f832
4 changed files with 62 additions and 45 deletions
|
|
@ -129,6 +129,7 @@ if (process.env.MEILI_HOST && process.env.MEILI_MASTER_KEY) {
|
|||
}
|
||||
|
||||
messageSchema.index({ createdAt: 1 });
|
||||
messageSchema.index({ messageId: 1, user: 1 }, { unique: true });
|
||||
|
||||
const Message = mongoose.models.Message || mongoose.model('Message', messageSchema);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue