Skip to content

Add startup cleanup service for soft-deleted tasks older than 30 days #206

Description

@MessiasLima

Description

Soft-deleted tasks accumulate locally (and remotely for premium subscribers) until they are permanently removed. This ticket adds a startup service that hard-deletes tasks whose soft-deletion is older than 30 days, respecting subscription status by only touching local data for free users.

Scope

  • In scope: startup cleanup service, 30-day retention threshold, local database cleanup for all users, Supabase cleanup for subscribers, wiring to app launch.
  • Out of scope: UI for retention settings, user-controlled deletion, sync conflict resolution.

Acceptance criteria

  • GIVEN the app starts
    WHEN the cleanup service runs
    THEN it queries local tasks where isDeleted = true and lastUpdatedAt is older than 30 days
  • GIVEN a soft-deleted local task is older than 30 days
    WHEN the cleanup service runs
    THEN the task is permanently deleted from the local database
  • GIVEN the user is a premium subscriber
    WHEN the cleanup service runs
    THEN it also queries Supabase for soft-deleted tasks older than 30 days and hard-deletes them
  • GIVEN the user is not subscribed
    WHEN the cleanup service runs
    THEN only the local database is checked and no remote calls are made
  • GIVEN the cleanup service runs
    THEN soft-deleted tasks within the 30-day window are not deleted

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