Skip to content

[upstream #17033] 17033: Keep Mongoose types out of the eraseUserData dependency contract #329

Open

Description

@berry-13

Raised by Codex on LibreChat-AI#17033: LibreChat-AI#17033 (comment)

UserErasureDeps in packages/api/src/user/erasure.ts is built from Pick<AllMethods, ...> and IMongoFile[], so the exported erasure service carries Mongoose Document, filter and ObjectId shapes, and eraseUserData converts the user id with mongoose.Types.ObjectId itself. AGENTS.md asks that packages/api exports take plain typed objects and leave ObjectId conversion inside packages/data-schemas.

These are the same method contracts the controller cascade already called from /api before LibreChat-AI#17033; the PR moved the call sequence, not the method shapes. A fix needs string-id variants of deleteBalances, deleteAllAgentApiKeys and deleteAllAgentQueuedTurnsForUser, a plain file shape for getFiles/deleteStoredFiles, and narrow dependency signatures in place of Pick<AllMethods>.

Activity

  1. added
    refactorreviewctl followups state
    readyreviewctl followups state
    and removed on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: packagesreviewctl followups statereadyreviewctl followups staterefactorreviewctl followups state

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions