Description
Current State
There are three files handling task operations with overlapping functionality:
lib/task-service.ts - Original implementation
lib/task-service-db.ts - Database-focused version
lib/supabase-task-service.ts - Supabase-specific version
This happened during iterative development where different approaches were tried. It's unclear which is authoritative, and bugs may exist where one is updated but not the others.
Why this exists
AI-assisted development sometimes creates new implementations rather than modifying existing ones when hitting issues. This is a known pattern in AI-augmented codebases.
Desired Outcome
- Audit all three files to identify unique functionality
- Create a single
lib/services/task-service.ts following the pattern in lib/services/time-entry-service.ts
- Update all imports to use the consolidated service
- Delete the deprecated files
How to get started
- Read all three files to understand their APIs
- Use
grep -rn "task-service" app/ components/ to find all usages
- Create consolidated implementation with all needed functions
- Update imports one by one, testing after each change
Related files to consolidate
lib/organization-service.ts
lib/organization-service-mock.ts
lib/organization-service-simple.ts
Acceptance Criteria
Description
Current State
There are three files handling task operations with overlapping functionality:
lib/task-service.ts- Original implementationlib/task-service-db.ts- Database-focused versionlib/supabase-task-service.ts- Supabase-specific versionThis happened during iterative development where different approaches were tried. It's unclear which is authoritative, and bugs may exist where one is updated but not the others.
Why this exists
AI-assisted development sometimes creates new implementations rather than modifying existing ones when hitting issues. This is a known pattern in AI-augmented codebases.
Desired Outcome
lib/services/task-service.tsfollowing the pattern inlib/services/time-entry-service.tsHow to get started
grep -rn "task-service" app/ components/to find all usagesRelated files to consolidate
lib/organization-service.tslib/organization-service-mock.tslib/organization-service-simple.tsAcceptance Criteria
lib/services/task-service.tswith all task operations