Skip to content

Conversation

wenxi-onyx
Copy link
Member

Description

Fixes https://linear.app/danswer/issue/DAN-2087/script-for-hard-deleting-old-chats

For hard deleting chats that were deleted prior to HARD_DELETE_CHATS was enabled.

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@wenxi-onyx wenxi-onyx requested a review from a team as a code owner June 12, 2025 20:42
Copy link

vercel bot commented Jun 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2025 8:44pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added a new maintenance script backend/scripts/hard_delete_chats.py for permanently removing previously soft-deleted chat sessions, utilizing existing database infrastructure.

  • Script safely hard deletes chat sessions using delete_chat_session function from onyx.db.chat
  • Implements user confirmation prompt and per-session error handling for safe execution
  • Provides progress reporting during deletion process to track status
  • One-time cleanup tool specifically targeting chat sessions marked as deleted before HARD_DELETE_CHATS was enabled

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@wenxi-onyx wenxi-onyx merged commit d5ecaea into main Jun 14, 2025
11 checks passed
@wenxi-onyx wenxi-onyx deleted the hard_delete_script branch June 14, 2025 08:06
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
Co-authored-by: Wenxi Onyx <wenxi-onyx@Wenxis-MacBook-Pro.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant