-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
P0Production blocker - must fix immediatelyProduction blocker - must fix immediatelycore-dataCore Data framework relatedCore Data framework relateddata-persistenceData storage and persistence issuesData storage and persistence issuesenhancementNew feature or requestNew feature or request
Description
📋 Sub-task of #86
Description
Replace the in-memory DefaultItemRepository with a Core Data backed implementation.
Current Implementation
- DefaultItemRepository.swift uses DispatchQueue and array storage
- All data is lost on app restart
Implementation Tasks
- Create CoreDataItemRepository conforming to ItemRepository protocol
- Implement all CRUD operations using Core Data
- Add batch operations for performance
- Implement fuzzy search using Core Data predicates
- Add proper error handling and recovery
- Optimize fetch requests with proper indexes
Key Methods to Implement
- fetchAll() - with pagination support
- fetch(id:) - optimized single item fetch
- save(_:) - with conflict resolution
- delete(_:) - with cascade handling
- search(query:) - full text search
- fetchByCategory(_:) - filtered queries
- fetchByLocation(_:) - relationship queries
Performance Requirements
- Fetch 10,000 items < 100ms
- Save batch of 100 items < 500ms
- Search response < 50ms
Migration Path
- Create parallel implementation
- Add feature flag for gradual rollout
- Implement data migration from existing storage
- Deprecate DefaultItemRepository
Testing Requirements
- Unit tests for all CRUD operations
- Performance tests with large datasets
- Concurrent access tests
- Error recovery tests
Estimated Effort: 3-4 days
Metadata
Metadata
Assignees
Labels
P0Production blocker - must fix immediatelyProduction blocker - must fix immediatelycore-dataCore Data framework relatedCore Data framework relateddata-persistenceData storage and persistence issuesData storage and persistence issuesenhancementNew feature or requestNew feature or request