Skip to content

[Data-integrity] DELETE /api/user/profile orphans GithubData/ApexConversation/reminders — personal data survives account deletion #343

Description

@vedant7007

Account deletion only cleans up Codeforces data, leaving other collections (including ones embedding the users email and analytics) in the database forever.

Root cause

server/modules/user/service.js:37-48 (deleteAccount) deletes CodeforcesProfile, CodeforcesSubmission, CodeforcesRatingHistory, then the User. It never deletes:

  • GithubData (unique per userId, models/GithubData.js:4-10) — orphaned GitHub cache persists.
  • ApexConversation (models/ApexConversation.js) — orphaned, and its contextSnapshot/contextPromptBlock embed the users email + full CF/GitHub analytics (built in utils/apexContextCompiler.js:311-320).
  • ContestReminder and any pending Otp rows.

Failure scenario

A user connects GitHub + uses APEX chat, then deletes their account. The User row is gone, but ApexConversation docs (name, email, ratings, repo/language stats) and GithubData remain in Mongo permanently — unreachable by the user and never cleaned up. "Delete my account" doesnt actually delete the personal data.

Fix

Extend the deletion cascade to GithubData, ApexConversation, ContestReminder, and pending Otp records (all keyed by userId/email), ideally in a transaction.

Dedup

No matching issue; no PR touches the user module. Unreported.

Contributing as part of Elite Coders Summer of Code (ECSoC 2026).

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