Files
Paul 88f06226f0 fix: "No client field found for ..." 500 error in version diff (#18001)
## Description

Backports #17952 to the `3.x` branch.

When a block is replaced between collection versions, the version diff
merged the source and replacement schemas by field name and then
traversed them with the replacement block's schema path and permissions.
Historical source fields—especially inside unnamed rows, collapsibles,
or tabs—could therefore resolve to a missing client schema entry and
throw `No client field found for ...`, surfacing as a production client
application error.

This backport:

- renders source and replacement block schemas independently with their
own schema paths and permissions
- avoids merging fields from blocks with different slugs on the client
- counts source removals and replacement additions independently for
collection and row badges
- adds unit and Playwright regression coverage for the production
failure

## Testing

- `pnpm exec vitest run
packages/next/src/views/Version/RenderFieldsToDiff/buildVersionFields.spec.ts
packages/next/src/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.ts
packages/next/src/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.ts
packages/next/src/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.ts`
(33 passed)
- `pnpm build:next` (5 tasks passed)
- `PORT=3012 pnpm test:e2e versions --grep="should render a replaced
block when both block schemas contain unnamed layouts" --workers=1` (1
passed)
- scoped production ESLint (0 errors; 3 existing warnings)
2026-09-03 17:54:43 +00:00
..