Repository navigation
Conversation
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
AlessioGr
marked this pull request as draft
February 5, 2026 04:33
auto-merge was automatically disabled
February 5, 2026 04:33
Pull request was converted to draft
brunoccalmeida
added a commit
to brunoccalmeida/playwright-nextjs-e2e-ci
that referenced
this pull request
Nov 19, 2026
Closes #40 The admin panel's seed button fails because of two separate defects. Each now has a measured cause, the component responsible and a decision about reporting it. The outward step (sending the reports) belongs to the repository owner and is tracked in #60, with the texts ready. ## Findings | Defect | Component | Measured | Upstream | | --- | --- | --- | --- | | **KI-9:** a form that has submissions cannot be deleted (`500`, Postgres `23502`) | Payload: a required relationship becomes `NOT NULL` + `ON DELETE SET NULL` | Every attempt, through `DELETE /api/forms/:id`, without the seed, on this repo (3.93.0) and on a new 3.94.0 app | Already reported: payloadcms/payload#11177 (open since Feb 2025), draft fix payloadcms/payload#15520. Decision: comment there with the template angle, no new issue | | **Seed race:** the seed clears collections in parallel with `Promise.all`, outside a transaction | The `website` template (`src/endpoints/seed/index.ts`, same code on Payload's `main` at `a68c2d3`) | New 3.94.0 app, production build: seed data only 5/30 failed (`40P01` deadlock); with one submission 5/8 (four `23502`, one `40P01`). This repo: 4/19 seed-only | No report found. Decision: report it under `area: templates`, or open a PR with the measured fix | Answers to the issue's four questions: 1. **One bug or two?** Two. Deleting a form with submissions fails on its own (KI-9). The seed's `Promise.all` adds a race that exposes KI-9 and also deadlocks: in the Postgres log, `delete from "media"` nulls rows of `pages_blocks_media_block` and `posts` while `delete from "pages"`/`"posts"` deletes them in another order. 2. **Deadlock on an untouched template?** Yes, with no extra rows at all: the seed's own data is enough. The earlier "8 of 8 passed" was too small a sample. 3. **New app on a production build?** Same failures (table above). 4. **Existing report?** #11177 for KI-9; nothing for the seed race (searches listed in `docs/KNOWN_ISSUES.md`). **Measured fix for the seed** (applied only to the throwaway app; this repo's app stays frozen): clear the collections one at a time, `form-submissions` before `forms`, which gave 0 failures in the same 38 runs. `scripts/seed.ts` already does this, so `pnpm db:seed` is unaffected. ## Changes - `tests/api/forms.spec.ts`: three tests. A control test (a form without submissions is deleted), a plain test proving `submitForm` (stored against its form), and the KI-9 `test.fail`. - `createForm` and `submitForm` fixtures, and the form and submission schemas, measured from real responses. - `docs/KNOWN_ISSUES.md`: KI-9 is new, and the seed entry is rewritten with the new measurements, mechanism, fix and upstream status. - READMEs: 66 tests, API 22, 9 bug tests, KI-9 row, `/api/forms` in the API descriptions. - Session summary: state, the queue and a local trap (KI-7, below). ## Decisions - **KI-9 got a test, the seed race did not.** The project rule puts a defect in "without a test" only when a test cannot pin it. KI-9 is deterministic. The race is intermittent, and testing it would erase the shared seed. - **The KI-9 test accepts any non-5xx response.** Deleting the form and refusing with a `4xx` that says why are both correct. Asserting `200` would hide a fix that refuses, because `test.fail` accepts any failure. - **`submitForm` depends on `createForm` only for teardown order** (a form with submissions cannot be deleted). Playwright reads the dependency from the destructuring, so the unused name carries an `eslint-disable-next-line` with that reason. This is the suite's first one. Widening the lint config to allow `_`-prefixed arguments would change a gate for one line. - **The reproduction ran on a fresh `[email protected]`**, pinned, in production mode, with a separate Postgres 18 on port 5433, following the template README (`migrate:create`, `migrate`, `build`, `start`). This is what Payload's bug form asks for. Node 26.13.0 is just below 3.94.0's new engines range, so the 3.93.0 numbers from this repo are kept as corroboration. - **The upstream texts are not sent from here.** They are drafts for the owner, in #60. ## Sources - Payload 3.93.0 [`docs/database/transactions.mdx`](https://github.com/payloadcms/payload/blob/v3.93.0/docs/database/transactions.mdx): custom endpoints control their own transactions, and `req` only carries one that was opened. - Payload's [bug report form](https://github.com/payloadcms/payload/blob/main/.github/ISSUE_TEMPLATE/1.bug_report_v3.yml) and [reproduction guide](https://github.com/payloadcms/payload/blob/main/.github/reproduction-guide.md): a public reproduction link is required, and versions must be exact. - [PostgreSQL 18, Deadlocks](https://www.postgresql.org/docs/18/explicit-locking.html#LOCKING-DEADLOCKS): take locks in a consistent order, or retry. - Playwright 1.65.0 [`test-fixtures-js.md`, "Execution order"](https://github.com/microsoft/playwright/blob/v1.65.0/docs/src/test-fixtures-js.md): a fixture is torn down before the ones it depends on. - `npm view [email protected] engines` / `@3.93.0`: the Node requirement, posted on #51. ## RED - **Fixtures written after the spec:** `pnpm typecheck` reported TS2305 (no exported member `formSchema`) and TS2339 (`createForm`, `submitForm` missing). - **KI-9 as a plain `test()`:** `Expected: < 500, Received: 500`. The server log showed `null value in column "form_id" of relation "form_submissions" violates not-null constraint`, the bug's own reason and not a test error. - **Control test** (mutated to expect `201`): `Expected HTTP 201, received 200`. Reverted. - **Submission test** (mutated to `form.id + 1`): `- "id": 9 / + "id": 8`. Reverted. - **`check:readme`** failed until both READMEs listed KI-9 and the new counts. ## Gates - `pnpm check` is green. - `CI=1 pnpm test:e2e` on a fresh database and a fresh build: 66 of 66 as expected. - One earlier local run with parallel workers had KI-7's test pass unexpectedly (`Expected to fail, but passed`). The cause is known: KI-7 depends on the first route that initializes Payload. The rerun and the CI-mode runs were green. The session summary now records "validate with `CI=1`" as a local trap. ## Reviewer (`mission:reviewer`) - **Fixed:** `submitForm` was only exercised inside the KI-9 `test.fail`, so a broken submission would have counted as the expected failure. A plain test now proves it. - **Fixed:** the "no report found" and "same code on `main`" claims had no source. The seed is now pinned at `a68c2d3`, and the searches are listed. - **Fixed:** the docs now say explicitly that the deadlock needs no extra rows. - **Addressed by #60:** the public reproduction and the sending of the reports. Both need the owner to publish, so they are a follow-up and do not keep #40 open. - **Discarded:** "RED not verified". It is recorded in commit `8ff827b` (above); the reviewer could not read commit bodies. ## Other findings - Payload 3.94.0 requires Node `>=26.13.1`, and `.node-version` pins 26.13.0. Posted on #51; the Payload 3.94 bump needs a Node bump in the same change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Required relationship fields were generating incompatible schema:
NOT NULLconstraint withonDelete: 'set null'. When deleting a parent document, PostgreSQL would error because it can't set a required field to null.Now uses
onDelete: 'cascade'for required relationships, so child documents are deleted with their parent.Fixes #14576
TODO: this is not the proper solution. Do more research