Skip to content

Conversation

@newfish-cmyk
Copy link
Collaborator

No description provided.

@gru-agent
Copy link
Contributor

gru-agent bot commented Jan 8, 2026

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 59cd29e ✅ Finished

History Assignment

Files

File Pull Request
projects/app/src/components/core/chat/ChatContainer/utils.ts 🔴 Closed #6218

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Preview mcp_server Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_mcp_server_dfaacb96fa1d9843cfc29e48959fa3aacd51fa87

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Preview sandbox Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_sandbox_dfaacb96fa1d9843cfc29e48959fa3aacd51fa87

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Preview fastgpt Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_dfaacb96fa1d9843cfc29e48959fa3aacd51fa87

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements soft delete functionality for chat items, allowing deleted chat messages to be retained in the database with a deleteTime timestamp instead of being permanently removed. In the logs view, deleted items are grouped and displayed in collapsible sections.

Key Changes:

  • Converted hard delete to soft delete by adding a deleteTime field to chat items instead of removing them from the database
  • Added UI support for viewing deleted chat items in collapsible groups (logs view only)
  • Updated queries to filter out soft-deleted items by default, with an optional includeDeleted parameter

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
projects/app/src/pages/api/core/chat/item/delete.ts Changed from hard delete to soft delete using updateOne with deleteTime
projects/app/src/pages/api/core/chat/getRecords_v2.ts Added includeDeleted parameter to support fetching deleted records
projects/app/src/pageComponents/app/detail/Logs/DetailLogsModal.tsx Enabled includeDeleted flag for log viewing
projects/app/src/global/core/chat/api.d.ts Added includeDeleted type definition to API request types
projects/app/src/components/core/chat/ChatContainer/utils.ts Added utility function to group chat items by delete status
projects/app/src/components/core/chat/ChatContainer/DeletedItemsCollapse.tsx New component for displaying collapsed deleted items
projects/app/src/components/core/chat/ChatContainer/ChatBox/index.tsx Added logic to render deleted items in collapsible groups for log type chats
packages/web/i18n/zh-Hant/app.json Added Traditional Chinese translations for collapse/expand actions
packages/web/i18n/zh-CN/app.json Added Simplified Chinese translations for collapse/expand actions
packages/web/i18n/en/app.json Added English translations for collapse/expand actions
packages/service/core/chat/controller.ts Updated getChatItems to support includeDeleted and filter by deleteTime
packages/service/core/chat/chatItemSchema.ts Added deleteTime field and updated indexes
packages/global/openapi/core/chat/controler/api.ts Added coerce.boolean for loadCustomFeedbacks parameter
packages/global/core/chat/type.d.ts Added deleteTime field to ChatItemSchemaType and ChatSiteItemType

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@c121914yu c121914yu requested a review from Copilot January 9, 2026 07:22
@c121914yu c121914yu changed the base branch from main to v4.14.5-dev January 9, 2026 07:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 12 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +22 to +31
await MongoChatItem.updateOne(
{
appId,
chatId,
dataId: contentId
}).session(session);

if (item?.obj === ChatRoleEnum.Human && delFile) {
const s3ChatSource = getS3ChatSource();
for (const value of item.value) {
if (value.type === ChatItemValueTypeEnum.file && value.file?.key) {
await s3ChatSource.deleteChatFileByKey(value.file.key);
}
}
},
{
$set: { deleteTime: new Date() }
}
});
);
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updateOne operation does not check if the update was successful or if the record exists. Consider checking the result of the updateOne operation to verify that a record was actually updated and return an appropriate error if the contentId doesn't exist.

Copilot uses AI. Check for mistakes.
processedRecords,
toggleDeletedGroup,
itemRefs,
chatRecords,
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chatRecords dependency in the RecordsBox useMemo is redundant since processedRecords already depends on chatRecords and is included in the dependency array. Including both can cause unnecessary re-renders. Consider removing chatRecords from this dependency array.

Suggested change
chatRecords,

Copilot uses AI. Check for mistakes.
@c121914yu c121914yu merged commit 16beadc into labring:v4.14.5-dev Jan 9, 2026
5 checks passed
c121914yu added a commit that referenced this pull request Jan 9, 2026
* refactor: fastgpt object storage & global proxy (#6155)

* feat: migrate to fastgpt storage sdk

* chore: rename env variable

* chore: move to sdk dir

* docs: object storage

* CHORE

* chore: storage mocks

* chore: update docker-compose

* fix: global proxy agent

* fix: update COS proxy

* refactor: use fetch instead of http.request

* fix: axios request base url

* fix: axios proxy request behavior

* fix: bumps axios

* fix: patch axios for proxy

* fix: replace axios with proxied axios

* fix: upload txt file encoding

* clean code

* fix: use "minio" for minio adapter (#6205)

* fix: use minio client to delete files when using minio vendor (#6206)

* doc

* feat: filter citations and add response button control (#6170)

* feat: filter citations and add response button control

* i18n

* fix

* fix test

* perf: chat api code

* fix: workflow edge overlap and auto-align in folded loop nodes (#6204)

* fix: workflow edge overlap and auto-align in folded loop nodes

* sort

* fix

* fix edge

* fix icon

* perf: s3 file name

* perf: admin get app api

* perf: catch user error

* fix: refactor useOrg hook to use debounced search key (#6180)

* chore: comment minio adapter (#6207)

* chore: filename with suffix random id

* perf: s3 storage code

* fix: encode filename when copy object

---------

Co-authored-by: archer <[email protected]>

* fix: node card link

* json

* perf: chat index;

* index

* chat item soft delete (#6216)

* chat item soft delete

* temp

* fix

* remove code

* perf: delete chat item

---------

Co-authored-by: archer <[email protected]>

* feat: select wheather filter sensitive info when export apps (#6222)

* fix some bugs (#6210)

* fix v4.14.5 bugs

* type

* fix

* fix

* custom feedback

* fix

* code

* fix

* remove invalid function

---------

Co-authored-by: archer <[email protected]>

* perf: test

* fix file default local upload (#6223)

* docs: improve object storage introduction (#6224)

* doc

---------

Co-authored-by: roy <[email protected]>
Co-authored-by: heheer <[email protected]>
Co-authored-by: Finley Ge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants