payloadcms / payloadcms/payload

`in` doesn't filter polymorphic relationship when using `uuid` and empty array

Open
#16,195 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: core stale status: needs-triage
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Describe the Bug

Queries with in:[] on polymorphic relationship doesn't work when using uuid.

access: {
    read: () => ({
      'permissions.entity.value': { in: [] },
    }),
  },

Would not filter anything.

Only saw this #10788 as related.

Link to the code that reproduces this issue

https://github.com/Xmaster6y/bug-in

Reproduction Steps
  1. Create a group or user
  2. Create a page
  3. Go to the page listing an observe the query not being satisfied
Which area(s) are affected?

area: core

Environment Info
Binaries:
  Node: 24.8.0
  npm: 11.11.0
  Yarn: 1.22.22
  pnpm: 10.17.0
Relevant Packages:
  payload: 3.81.0
  next: 16.2.1
  @payloadcms/db-sqlite: 3.81.0
  @payloadcms/drizzle: 3.81.0
  @payloadcms/graphql: 3.81.0
  @payloadcms/next/utilities: 3.81.0
  @payloadcms/richtext-lexical: 3.81.0
  @payloadcms/translations: 3.81.0
  @payloadcms/ui/shared: 3.81.0
  react: 19.2.4
  react-dom: 19.2.4
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:29:54 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T8122
  Available memory (MB): 16384
  Available CPU cores: 8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction repository and its page-listing query, then trace how the core database query handles an empty in array on a polymorphic relationship with UUID values. Confirm the behavior against the reported Payload 3.81.0 setup; done means the filter excludes records as expected, with regression coverage for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
sqlite, typescript
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.