Skip to content

Fix account deletion failing on non-archived notes #65

Description

@thermcampos

What to build

A user who confirms account deletion gets all of their data removed — notes regardless of archived state, note URLs, tags, and tasks — instead of the request failing and silently rolling back.

Today the account-deletion flow reuses the single-note delete path, which enforces the trash-can business rule "only archived notes may be deleted" and throws on the first non-archived note. Because the whole flow runs in one transaction, that exception aborts the entire account deletion. The archived-only rule is correct for the single-note API and must stay; account deletion needs its own bulk path that deletes every note the user owns, archived or not, along with their note URLs and any remaining tags, so the final user-row delete hits no foreign-key blockers.

Acceptance criteria

  • A user with a mix of archived and non-archived notes (with tags and note URLs) can delete their account; all their rows are gone afterwards
  • The single-note delete endpoint still rejects non-archived notes (trash-can rule unchanged)
  • Tags owned by the user are fully removed during account deletion, not just orphaned ones
  • Integration test against a real database covers the mixed archived/non-archived scenario end to end
  • Existing account-deletion unit tests updated for the new flow

Blocked by

  • None (can start immediately)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions