omi icon indicating copy to clipboard operation
omi copied to clipboard

feat: add auto-discard and restore for short conversations

Open saicharan0810 opened this issue 1 year ago • 1 comments

Implement automatic discarding of conversations shorter than 30 seconds with ability to restore them. This helps reduce clutter from accidental or test recordings while preserving user control.

Backend changes:

  • Add duration, discarded_reason, discarded_at, restored_at fields to Conversation model
  • Add 'discarded' status to ConversationStatus enum
  • Implement auto-discard logic for conversations < 30 seconds
  • Add /discard and /restore API endpoints
  • Add Firestore composite index for efficient querying
  • Add test endpoints for validation

Frontend changes:

  • Update conversation data model with discard fields
  • Add discardConversation() and restoreConversation() API functions
  • Implement restoreConversationLocally() in provider
  • Add smart swipe actions (green restore for discarded, red delete for active)
  • Add "Show Discarded" toggle switch on conversations page
  • Update conversation cards to show "Auto-discarded" tag

Tested:

Backend API endpoints - Fully tested with curl commands: -Auto-discard for < 30s conversations: WORKING -Restore endpoint: WORKING -Statistics tracking: WORKING -Test endpoints: ALL WORKING Code syntax and structure - All verified -Frontend code follows existing patterns -Backend code integrates correctly -No syntax errors Edge cases handled in code -Null checks for optional fields -Status validation -Proper error handling in API calls

saicharan0810 avatar Nov 20 '25 18:11 saicharan0810

This helps reduce clutter from accidental or test recordings while preserving user control.

i am confusing, tell me more about the real-use case.

beastoin avatar Nov 26 '25 02:11 beastoin