Skip to content

chat log soft delete#6110

Merged
c121914yu merged 6 commits intolabring:mainfrom
newfish-cmyk:log-delete
Dec 18, 2025
Merged

chat log soft delete#6110
c121914yu merged 6 commits intolabring:mainfrom
newfish-cmyk:log-delete

Conversation

@newfish-cmyk
Copy link
Copy Markdown
Contributor

No description provided.

@gru-agent
Copy link
Copy Markdown
Contributor

gru-agent bot commented Dec 17, 2025

⏳ Processing in progress

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 17, 2025

Preview mcp_server Image:

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 17, 2025

Preview sandbox Image:

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 17, 2025

Preview fastgpt Image:

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

Copy link
Copy Markdown
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 logs, introducing a new deleteTime field to the chat schema. The implementation differentiates between user-facing soft deletes (for chat history management) and administrative hard deletes (for log management with proper permissions).

Key changes include:

  • Added soft delete capability with a new deleteTime field in the chat schema and updated database indexes
  • Created new API endpoints for chat history management (getHistories, updateHistory, delHistory, clearHistories, batchDelete)
  • Implemented batch delete functionality in the logs UI with multi-select capability

Reviewed changes

Copilot reviewed 34 out of 38 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/service/core/chat/chatSchema.ts Added deleteTime field to chat schema and updated indexes to support soft delete filtering
packages/global/openapi/core/chat/history/api.ts Defined Zod schemas for new chat history API endpoints with proper validation
packages/global/openapi/core/chat/history/index.ts Added OpenAPI documentation for chat history management endpoints
projects/app/src/pages/api/core/chat/history/delHistory.ts New endpoint for soft deleting a single chat history
projects/app/src/pages/api/core/chat/history/clearHistories.ts Modified to use soft delete instead of hard delete for clearing chat histories
projects/app/src/pages/api/core/chat/history/batchDelete.ts New endpoint for hard deleting multiple chats (admin function for log management)
projects/app/src/pages/api/core/chat/history/updateHistory.ts Updated to use new schema validation and updateOne instead of findOneAndUpdate
projects/app/src/pages/api/core/chat/history/getHistories.ts Modified to exclude soft-deleted chats from results
projects/app/src/web/core/chat/history/api.ts New API client functions for chat history management
projects/app/src/pageComponents/app/detail/Logs/LogTable.tsx Added batch delete UI with multi-select checkboxes and floating action bar
packages/web/hooks/useTableMultipleSelect.tsx Enhanced to support custom active background color
packages/web/components/common/MyPopover/PopoverConfirm.tsx Improved event handling with stopPropagation for better UX
packages/web/i18n/*/app.json Added translations for delete confirmation messages
test/mocks/common/s3.ts Added mock functions for S3 chat source operations to support testing
projects/app/test/api/core/chat/history/*.test.ts Comprehensive test coverage for all new history API endpoints

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

Comment thread projects/app/src/pages/api/core/chat/history/batchDelete.ts Outdated
Comment thread projects/app/src/pages/api/core/chat/history/batchDelete.ts
Comment thread packages/web/i18n/en/app.json Outdated
Comment thread packages/web/hooks/useTableMultipleSelect.tsx
Comment thread packages/global/openapi/core/chat/history/index.ts
Comment thread packages/global/openapi/core/chat/history/index.ts Outdated
c121914yu and others added 3 commits December 17, 2025 23:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

Docs Preview:


🚀 FastGPT Document Preview Ready!

🔗 👀 Click here to visit preview

@c121914yu c121914yu merged commit 09b9fa5 into labring:main Dec 18, 2025
7 checks passed
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.

3 participants