-
Notifications
You must be signed in to change notification settings - Fork 11
Remove legacy KV chat archive UI #567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bdadbc9
f8b559b
1e473e3
4557288
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,24 +56,12 @@ import packageJson from "../../package.json"; | |
| import { SIDEBAR_ACCOUNT_MENU_WIDTH_CLASS, SIDEBAR_LAYOUT_STYLE } from "@/constants/layout"; | ||
|
|
||
| function ConfirmDeleteDialog() { | ||
| const { clearHistory } = useLocalState(); | ||
| const os = useOpenSecret(); | ||
| const queryClient = useQueryClient(); | ||
| const navigate = useNavigate(); | ||
|
|
||
| async function handleDeleteHistory() { | ||
| // 1. Delete archived chats (KV) | ||
| try { | ||
| await clearHistory(); | ||
| console.log("History (KV) cleared"); | ||
| } catch (error) { | ||
| console.error("Error clearing history:", error); | ||
| // Continue to delete server conversations even if this fails | ||
| } | ||
|
|
||
| // 2. Delete server conversations (API) if any exist | ||
| try { | ||
| // Check if we have any conversations to delete | ||
| const conversations = await os.listConversations({ limit: 1 }); | ||
| if (conversations.data && conversations.data.length > 0) { | ||
| await os.deleteConversations(); | ||
|
|
@@ -84,10 +72,13 @@ function ConfirmDeleteDialog() { | |
| } | ||
|
|
||
| // Always refresh UI and navigate home | ||
| queryClient.invalidateQueries({ queryKey: ["chatHistory"] }); | ||
| queryClient.invalidateQueries({ queryKey: ["conversations"] }); | ||
| queryClient.invalidateQueries({ queryKey: ["archivedChats"] }); | ||
| queryClient.invalidateQueries({ queryKey: ["pinnedConversations"] }); | ||
| queryClient.invalidateQueries({ queryKey: ["projectConversations"] }); | ||
| queryClient.invalidateQueries({ queryKey: ["conversationProjects"] }); | ||
| queryClient.invalidateQueries({ queryKey: ["conversationProject"] }); | ||
| navigate({ to: "/" }); | ||
|
Comment on lines
72
to
80
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 Orphaned KV data not cleaned up when deleting all history The old (Refers to lines 63-80) Was this helpful? React with 👍 or 👎 to provide feedback.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intentionally not adding a final |
||
| window.dispatchEvent(new CustomEvent("newchat", { detail: { projectId: null } })); | ||
| } | ||
|
|
||
| return ( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.