Conversation
TestGru AssignmentSummary
Tip You can |
2603091 to
a6b24ac
Compare
Preview sandbox Image: |
Preview mcp_server Image: |
Docs Preview:🚀 FastGPT Document Preview Ready! |
Preview fastgpt Image: |
There was a problem hiding this comment.
Pull request overview
This PR makes changes to chat persistence logic and API schema definitions. The main purpose appears to be improving data handling for chat logs, though the title "perf: redis del" suggests performance optimizations related to Redis that aren't directly visible in these changes.
Key changes:
- Added
createTimefield to the MongoDB update operation insaveChatfunction - Updated API schema to make
titleandcreateTimefields nullable in chat log responses
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/service/core/chat/saveChat.ts | Adds createTime field to the chat document update operation |
| packages/global/openapi/core/app/log/api.ts | Updates schema validation to make title and createTime fields nullable for API responses |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| createTime: new Date(), | ||
| updateTime: new Date() |
There was a problem hiding this comment.
Setting createTime to a new date on every update will overwrite the original creation time when the chat already exists. Since this operation uses upsert: true, the createTime should only be set when the document is first created.
Consider using $setOnInsert instead of $set for the createTime field to preserve the original creation timestamp on subsequent updates.
| createTime: new Date(), | |
| updateTime: new Date() | |
| updateTime: new Date() | |
| }, | |
| $setOnInsert: { | |
| createTime: new Date() |
a6b24ac to
80f30a9
Compare
No description provided.