Skip to content

Commit e00f6e6

Browse files
authored
Fix onboarding reset to clear backend chat history (#5500)
1 parent b93f673 commit e00f6e6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

desktop/Desktop/Sources/AppState.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,6 +2492,17 @@ class AppState: ObservableObject {
24922492
OnboardingChatPersistence.clear()
24932493
log("Cleared onboarding chat persistence")
24942494

2495+
// Clear persisted backend chat messages so onboarding does not resume old history.
2496+
// Onboarding currently uses the default chat message stream.
2497+
Task {
2498+
do {
2499+
_ = try await APIClient.shared.deleteMessages()
2500+
log("Cleared backend chat messages")
2501+
} catch {
2502+
logError("Failed to clear backend chat messages during onboarding reset", error: error)
2503+
}
2504+
}
2505+
24952506
// Clear all local user data: database, screenshots, videos, knowledge graph, etc.
24962507
let dataKeys = [
24972508
"omi.focus.sessions",

desktop/Desktop/Sources/MainWindow/Pages/SettingsPage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3828,7 +3828,7 @@ struct SettingsContentView: View {
38283828
appState.resetOnboardingAndRestart()
38293829
}
38303830
} message: {
3831-
Text("This will reset all permissions and restart the app. You'll need to grant permissions again during setup.")
3831+
Text("This will reset all permissions, clear chat history, and restart the app. You'll need to grant permissions again during setup.")
38323832
}
38333833
}
38343834
}

0 commit comments

Comments
 (0)