From daba3c04c0bcfa3101edbc10fd2c6ae881a4a4df Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Fri, 23 Oct 2026 00:48:10 +0200 Subject: [PATCH] fix: relation picker page size refused by entry list --- docs/release-notes.md | 1 + docs/releases/v3.5.1-beta.md | 9 +++++++++ web/src/lib/__tests__/relationField.spec.ts | 14 +++++++++++++- web/src/lib/relationField.ts | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 docs/releases/v3.5.1-beta.md diff --git a/docs/release-notes.md b/docs/release-notes.md index 25c333f..4cced1c 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -44,3 +44,4 @@ Each body lives in `docs/releases/.md`. Publish with `tea releases create - | `v3.4.1-beta` | Media field and security updates | | `v3.4.2-beta` | Security and privacy hardening | | `v3.5.0-beta` | Relation field | +| `v3.5.1-beta` | Relation picker fix | diff --git a/docs/releases/v3.5.1-beta.md b/docs/releases/v3.5.1-beta.md new file mode 100644 index 0000000..8e20ebf --- /dev/null +++ b/docs/releases/v3.5.1-beta.md @@ -0,0 +1,9 @@ +This release fixes the Relation field picker, which could not load any entries. + +## Improvements and fixes + +- Choosing a target for a Relation field no longer fails with "Couldn't load" and a `400` error. The picker asked for pages of 10 entries, a size the entry list refuses, and now asks for 25. + +## Upgrading + +- Replace the binary, or pull the new image. No schema migration and no new environment variable. diff --git a/web/src/lib/__tests__/relationField.spec.ts b/web/src/lib/__tests__/relationField.spec.ts index dd69a14..70853e7 100644 --- a/web/src/lib/__tests__/relationField.spec.ts +++ b/web/src/lib/__tests__/relationField.spec.ts @@ -14,7 +14,13 @@ import { ruleMessage } from '@/lib/entryMessages' import { groupFields } from '@/lib/entryLayout' import { classifyRefusal, parseEntryRefusal } from '@/lib/entryServerError' import { FIELD_TYPES, fieldTypeSpec } from '@/lib/fieldTypes' -import { isRelationId, relationIdsOf, summariesOf, type RelationSummary } from '@/lib/relationField' +import { + RELATION_PAGE_SIZE, + isRelationId, + relationIdsOf, + summariesOf, + type RelationSummary, +} from '@/lib/relationField' import { relationRowOf } from '@/lib/relationRows' import { ApiError } from '@/lib/apiError' import { diffFields } from '@/lib/schemaBuilderDiff' @@ -481,3 +487,9 @@ describe('relation in the builder model', () => { expect(data.speakers).toEqual([]) }) }) + +describe('the picker page size', () => { + it('is one of the sizes the entry list endpoint accepts', () => { + expect([5, 25, 50, 100]).toContain(RELATION_PAGE_SIZE) + }) +}) diff --git a/web/src/lib/relationField.ts b/web/src/lib/relationField.ts index e048a83..6075a82 100644 --- a/web/src/lib/relationField.ts +++ b/web/src/lib/relationField.ts @@ -7,7 +7,7 @@ export type RelationKind = (typeof RELATION_KINDS)[number] export const DEFAULT_RELATION_KIND: RelationKind = 'one_to_many' export const RELATION_MAX = 50 -export const RELATION_PAGE_SIZE = 10 +export const RELATION_PAGE_SIZE = 25 const RELATION_ID_MAX = 4294967295