Codemod add-override-access-true silently skips calls with spread or non-literal options
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- node.js, typescript
- Domain
- tooling
Research direction
The issue links to the proposed fix branch, which includes failing tests, migration guide updates, and README changes. Start by reviewing the add-override-access-true transform and its tests there; the issue does not name their paths. Done means skipped calls with spread or non-literal options produce a note with the file, line, callee, and reason, with the guide and README updated. An open pull request already addresses this work.
Written by the indexing model from the issue text.
Description
Describe the Bug
add-override-access-true leaves two kinds of Local API calls unchanged, and says nothing about them:
- calls whose options contain a spread, e.g.
payload.find({ ...opts, collection }); - calls whose argument is not an object literal, e.g.
payload.find(args)orpayload.jobs.queue(args).
In v4 overrideAccess defaults to false, so these calls start enforcing access control without anyone being told. A typecheck doesn't catch it either, because the property is optional.
The runner already has a notes channel (TransformResult.notes) for this. Other transforms use it with file:line: messages.
Link to the code that reproduces this issue
https://github.com/RafalFilipek/payload/tree/fix/codemod-report-skipped-override-access
This branch has the proposed fix and tests that fail without it. It adds a note for each skipped call (file, line, callee, reason) without guessing a value, and updates the migration guide and the README. (Area: @payloadcms/codemod, which is not in the list.)
Reproduction Steps
Run the codemod on:
const quiet = { overrideAccess: false }
await payload.find({ ...quiet, collection: 'posts' })
await payload.find(args)
Actual: no change and no message.
Which area(s) are affected?
area: core
Environment Info
Payload 4.0.0-beta, main
Generated by Claude Code
- Dominant language
- TypeScript
- Stars
- 45.5k
- Forks
- 4.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 295
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from payloadcms/payload
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19060 ·
Maintainers usually reply within 1 day
-
WhereBuilder throws "Cannot read properties of undefined (reading 'value')" when the list URL filters on a field that is not filterablePossibly taken A pull request linked to this issue is open or already merged. OpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19002 · 1 comment ·
Maintainers usually reply within 1 day
-
Regression: `findByID` with `disableErrors: true` throws `NotFound` for null/empty ids since 3.91.0Possibly taken @Krrishkumar125 claimed this 5 days ago. Openarea: core Bug invalid-reproduction status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
payloadcms/payload#18935 · 1 comment ·
Maintainers usually reply within 1 day
-
bug: Local API call with req resets req.fallbackLocale to defaultLocalePossibly taken A pull request linked to this issue is open or already merged. Openarea: core Bug created-by: Contributor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#18768 ·
Maintainers usually reply within 1 day
-
[plugin-multi-tenant] Infinite redirect loop with custom tenantFieldName and isGlobal collectionsPossibly taken A pull request linked to this issue is open or already merged. OpenBug plugin: multi-tenant status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
payloadcms/payload#18690 ·
Maintainers usually reply within 1 day
All issues in payloadcms/payload
Similar issues
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apex-dev-tools/apex-log-parser#199 ·
Maintainers usually reply within 1 day
-
area/frontend/library-panels automated-triage type/bug type/ux
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PostHog/posthog.com#21607 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
ajv-validator/ajv#2689 ·
-
[Bug]: IME confirmation Enter can submit the SSH port-forward dialogPossibly taken @seijikohara claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day