Skip to content

fix: address 30 Payload v4 core, database and plugin regressions - #1

Merged
ivan-fr merged 25 commits into
mainfrom
fix/payload-v4-server-regressions
Nov 3, 2026
Merged

ivan-fr merged 25 commits into
mainfrom
fix/payload-v4-server-regressions

Conversation

@ivan-fr

@ivan-fr ivan-fr commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

This PR fixes 30 scoped Payload 4.0.0-beta.6 core, database, storage and plugin regressions. It includes fork main at dec32f0 and preserves all previous fixes.

Six additional fixes in the latest batch:

Previous 24 fixes: payloadcms#18653, payloadcms#18935, payloadcms#19044, payloadcms#19067, payloadcms#19167, payloadcms#19244, payloadcms#19292, payloadcms#19267, payloadcms#19246, payloadcms#18191, payloadcms#18382, payloadcms#18180, payloadcms#18768, payloadcms#18324, payloadcms#19050, payloadcms#18338, payloadcms#18406, payloadcms#18055, payloadcms#18072, payloadcms#18656, payloadcms#19204, payloadcms#18339, payloadcms#19020 and payloadcms#18258.

Validation:

  • The initial new unit baseline had 9 failures and 14 passing controls across four files. The transaction-enabled integration baseline had five failures and one passing bulk-delete control. These demonstrated slug collisions, invalid GraphQL nullability, SQL overmatching, unprefixed MongoDB sorts, unpopulated virtual relationships/denied aliases reappearing, and earlier updates rolled back despite being returned as successes.
  • 2,055 unit tests passed across 206 files, with two pre-existing skips, covering core, GraphQL, Drizzle, MongoDB, PostgreSQL, SQLite and the previously tested plugins/storage packages.
  • 9 tests passed in the new shared-fixture SQLite integration suite, with real transactions explicitly enabled. Coverage includes virtual upload/relationship/hasMany fields at depths 0–3, maxDepth, denied read access, field selection, persisted bulk update/delete results, empty transaction sessions, and literal searches with adversarial decoy records. One MongoDB-only draft-read case is committed and skipped on SQLite.
  • TypeScript builds for PostgreSQL, MongoDB, SQLite and GraphQL passed; package/tool lint, repository formatting and all 24 CI helper tests passed.
  • The test TypeScript project includes existing cross-adapter/workspace diagnostics; none reference the new fixture files.

The new fixture is discovered by the full required GitHub Actions matrix. Local checks do not establish live MongoDB/Cosmos DB, PostgreSQL, external storage or real payment-provider results. The full required CI must pass on the final revision before merge; no required checks are removed or relaxed.

PostgreSQL pool integration for payloadcms#18406 remains included: five real PostgreSQL tests with pool.max=1 cover the missing-req negative control, concurrent updates/deletes, foreign-lock 423 enforcement and file rename persistence/bytes, with idle-connection, zero-waiter and empty-session assertions. The focused run passed on the preceding revision: https://github.com/ivan-fr/payload/actions/runs/41646960250 . This independent check runs again on the updated PR.

maintenance/payload-v4/README.md records detailed evidence and limits. The historical 565-issue snapshot now has 29 scoped fixes and 536 unassessed entries. Post-snapshot issue payloadcms#19292 is tracked separately, bringing the branch to 30 fixes. No upstream issue is closed by this fork. The ten-item ecommerce join cap (payloadcms#18498), untranslated validation messages (payloadcms#19021), and the remaining unassessed reports are not counted as fixed.

SonarCloud follow-up: replace the fixed PostgreSQL fixture password with a fresh CSPRNG-generated, masked password for each workflow run; publish the database port only on loopback and clean up the container. Add explicit source/test classification for automatic analysis and exclude only generated declarations/build/dependency outputs. Production and workflow code remain analysed and quality-gate thresholds are unchanged. Share handler-error construction and use String.raw for literal backslash escaping. Focused verification: 186 unit tests and both persisted-stack SQLite integration tests pass, along with TypeScript builds, lint, formatting and workflow YAML/bash validation. Await the new SonarCloud quality gate and full required CI on the final revision.

Fix the missing-preference deletion regression from payloadcms#19044 and cover joined no-match, normal lookup and numeric zero IDs.
Address payloadcms#19167 with SQLite predicate tests, PostgreSQL query compilation, and number/UUID controls.
Address payloadcms#18653. Preserve the original commit error, release sessions, and cover real deferred foreign key failure plus rollback and connection controls.
Address payloadcms#19067 by defaulting missing data to an empty object and verifying supplied data is preserved.
Complete the payloadcms#19067 fix by using the entity GraphQL name for global access types, with custom-name and fallback tests.
Address payloadcms#18935. Return null for invalid findByID inputs when disableErrors is true, retaining 404 behavior otherwise.
Address payloadcms#19244 with shared reload promises, error propagation for concurrent callers, and retry after a failed config or database reload.
Add authenticated SQLite REST integration coverage for payloadcms#19044, checking the 404 and preservation of unrelated preferences.
Add Payload SQLite query integration coverage for payloadcms#19167 using multiple partial words and case-insensitive matches.
Record the 565-issue snapshot, six scoped fixes and 559 unassessed reports. Include validation commands, 1618 passing unit tests, 3 passing SQLite integration tests, and outstanding PostgreSQL, MongoDB and D1 verification.
@ivan-fr
ivan-fr marked this pull request as ready for review November 2, 2026 13:15
@ivan-fr ivan-fr changed the title fix: address six Payload v4 server regressions fix: address twelve Payload v4 server and upload regressions Nov 3, 2026
Preserve Local API fallback locales, bound relative config discovery, support MCP trash deletion, reuse ecommerce and lock transactions, and retain job handler error causes/stacks.

Add regression coverage for upstream payloadcms#18768, payloadcms#18324, payloadcms#19050, payloadcms#18338, payloadcms#18406 and payloadcms#18055. Local validation: 1,982 unit tests, 10 selected SQLite integrations, project types, lint, formatting and 24 CI helper tests.
@ivan-fr ivan-fr changed the title fix: address twelve Payload v4 server and upload regressions fix: address eighteen Payload v4 core, storage and plugin regressions Nov 3, 2026
Run the complete required PR validation on the tested source tree.
Fix me draft parameters, PostgreSQL initialization errors, migration access, payment variant validation, latest-draft duplicate checks and MongoDB multi-key join sorting.

Regression coverage for upstream payloadcms#18072, payloadcms#18656, payloadcms#19204, payloadcms#18339, payloadcms#19020 and payloadcms#18258. Local validation: 2,038 unit tests, 15 selected SQLite integrations, types, lint, formatting and 24 CI helper tests. Live database coverage remains required on CI.
@ivan-fr ivan-fr changed the title fix: address eighteen Payload v4 core, storage and plugin regressions fix: address 24 Payload v4 core, database and plugin regressions Nov 3, 2026
Run the complete required PR checks on the tested source tree.
Add a real PostgreSQL max=1 fixture with bounded acquisition timeouts and five regression cases: the missing-request negative control, concurrent updates/deletes, foreign-lock and bulk-delete behavior, and file rename byte preservation.

Add a focused PostgreSQL Actions check while retaining discovery in the required full integration matrix. Local PostgreSQL is unavailable; remote execution must establish the result.
Execute the focused live PostgreSQL pool check and the complete required Payload 4 PR validation.
The live PostgreSQL run passed concurrent updates/deletes, 423 and bulk-lock behavior, and file rename. Match the wrapped pool timeout cause in the negative control rather than Drizzle's query message.
Cover slug collisions, MongoDB draft default sort, GraphQL named tabs,
literal SQL searches, virtual relationship population and bulk transactions.
Add shared-fixture integration coverage and update inventory to 30 fixes.
@ivan-fr ivan-fr changed the title fix: address 24 Payload v4 core, database and plugin regressions fix: address 30 Payload v4 core, database and plugin regressions Nov 3, 2026
…lization

Use a dedicated shared-fixture config so MongoDB task/workflow enums include
both handlers before models are compiled. Disable cron through fixture lifecycle
instead of mutating process globals or sanitized job configs after initialization.

Validation: both SQLite integration tests pass; actual Mongoose schema accepts
registered handler slugs and rejects an unknown task; lint and format pass.
Generate a masked ephemeral PostgreSQL password per run and bind its port to
loopback. Classify fixture/spec code as tests and exclude generated declarations,
without lowering quality thresholds or excluding production/workflow code.
Share handler-error construction and use raw SQL escape literals.

Validation: 186 unit tests, two persisted-stack integration tests, TypeScript
builds, lint, formatting and workflow YAML/bash syntax pass.
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@ivan-fr
ivan-fr merged commit b75da3b into main Nov 3, 2026
322 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

db-postgres / drizzle: commitTransaction resolves when the COMMIT fails, so a lost transaction looks like a success

1 participant