Skip to content

Implement soft delete for tasks via new isDeleted flag #202

Description

@MessiasLima

Description

Currently, tapping delete on the task detail permanently removes the task. To support future synchronization conflict resolution and provide a recovery window, tasks should be marked as deleted instead of being removed immediately. The existing hard-deletion path must remain available for future cleanup.

Scope

  • In scope: add isDeleted to Task, update the database migration with default false, add TaskRepository.markAsDeleted(id), wire TaskDetailViewModel.DeleteClicked to soft delete, keep existing hard delete methods.
  • Out of scope: UI for permanent deletion, automatic hard-deletion cleanup, exposing deleted tasks to the user.

Acceptance criteria

  • GIVEN a task exists
    WHEN the user taps delete on the task detail screen
    THEN the task is marked as deleted and remains in the database
  • GIVEN a task is marked as deleted
    WHEN the app loads today's tasks or task detail
    THEN the deleted task is not shown (unless explicitly requested by a future query)
  • GIVEN the codebase
    THEN TaskRepository exposes a markAsDeleted(id: Uuid) method that sets isDeleted = true and updates lastUpdatedAt
  • GIVEN existing tasks
    WHEN the migration runs
    THEN isDeleted defaults to false
  • GIVEN the codebase
    THEN the existing hard delete method remains available for permanent deletion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions