Skip to content

[REFACTOR] Consolidate task-service.ts, task-service-db.ts, and supabase-task-service.ts #6

@itigges22

Description

@itigges22

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

  1. Audit all three files to identify unique functionality
  2. Create a single lib/services/task-service.ts following the pattern in lib/services/time-entry-service.ts
  3. Update all imports to use the consolidated service
  4. Delete the deprecated files

How to get started

  1. Read all three files to understand their APIs
  2. Use grep -rn "task-service" app/ components/ to find all usages
  3. Create consolidated implementation with all needed functions
  4. 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

  • Single lib/services/task-service.ts with all task operations
  • All imports updated to use new service
  • Old service files deleted
  • All existing functionality preserved

Metadata

Metadata

Assignees

No one assigned

    Labels

    RefactorNeed to optimize the codebasehelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions