Skip to content

Mismatch of deleteAt typings #13341

Closed

Description

@SaschaPWittwer

Describe the Bug

The newly introduce "trash" functionality adds a deleteAt field to the collection and therefore also to the generated types.

While the generated typing for deletedAt is

deletedAt?: string | null;

The exported TypeWithID has a different definition

export type TypeWithID = {
  deletedAt?: string
  docId?: any
  id: number | string
}

This leads to type errors in our solution (Since null from generated types is not assignable to undefined | string from TypeWithID), so I wanted to ask if this is an oversight or by design?
If it is by design I wonder what the reason could be?

Link to the code that reproduces this issue

n/a

Reproduction Steps

  1. Mark any collection as trash: true
  2. Generate types generate:types
  3. Try to assign any object with generated type to TypeWithID

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

n/a

Activity

  1. added
    status: needs-triage
    validate-reproduction
    on Jul 31, 2025
  2. github-actions commented on Jul 31, 2025

    @github-actions
    Contributor

    Please add a reproduction in order for us to be able to investigate.

    Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided.

    Why was this issue marked with the invalid-reproduction label?

    To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with create-payload-app@latest -t blank or a forked/branched version of this repository with tests added (more info in the reproduction-guide).

    To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

    Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.

    I added a link, why was it still marked?

    Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

    Useful Resources

  3. removed
    validate-reproduction
    on Jul 31, 2025
  4. removed
    status: needs-triage
    on Aug 1, 2025
  5. PatrikKozak commented on Aug 4, 2025

    @PatrikKozak
    Contributor

    Hey @SaschaPWittwer - thanks for bringing this up!

    Just opened a PR to fix this - we'll get this merged and released asap!

  6. changed the title [-]Missmatch of `deleteAt` typings[/-] [+]Mismatch of `deleteAt` typings[/+] on Aug 5, 2025
  7. added a commit that references this issue on Aug 5, 2025
    8401b21
  8. github-actions commented on Aug 13, 2025

    @github-actions
    Contributor

    This issue has been automatically locked.
    Please open a new issue if this issue persists with any additional detail.

  9. locked as resolved and limited conversation to collaborators on Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions