docs: document the postgres 100-argument lock limit and drizzle patch
This commit is contained in:
parent
e3926ab828
commit
8174b32cd7
1 changed files with 1 additions and 0 deletions
|
|
@ -222,6 +222,7 @@ never to dense data UI, tables, forms, dialogs, buttons, or shadcn-styled surfac
|
|||
- `.npmrc` sets `legacy-peer-deps=true` for dependency resolution compatibility.
|
||||
- `bun run db push` fails with `must be owner of table spatial_ref_sys` (a PostGIS table owned by the DB superuser) — drizzle-kit push does a full-schema diff and trips on it. Workaround: apply the needed `ALTER TABLE` directly (via node + `pg` reading `DATABASE_URI` from `.env`) or use Payload's migration runner (`bun run payload migrate`).
|
||||
- **Payload 3 field-level access never rejects an update request**: when a field's `access` fn returns `false`, Payload silently deletes that field from the incoming data (`node_modules/payload/dist/fields/hooks/beforeValidate/promise.js`) and the save SUCCEEDS with the previous value. No 403, "Updated successfully." toast, other fields still save. It is enforcement without feedback; if you need a loud rejection or hidden dropdown options, that requires a collection `beforeChange` hook or a custom admin field component.
|
||||
- **Admin edit views throw `54023 cannot pass more than 100 arguments` once the unit approaches 100 collections**: `payload_locked_documents_rels` gains one FK column per collection and Drizzle hydrates the lock's polymorphic relationship with a single `json_build_array(...)`, which Postgres caps at 100 arguments. `drizzle-orm@0.45.2` is bun-patched (`patches/drizzle-orm@0.45.2.patch`) to chunk that call into 100-argument groups joined with `::jsonb ||`; keep the patch (and its `patchedDependencies` entry) when upgrading drizzle, and `tests/int/locked-documents-query.int.spec.ts` fails loudly if it is missing.
|
||||
- **Admin-panel-visible access bugs that contradict passing API tests**: check the actual role permission rows in the DB first, then the field-strip semantics above. The dev DB once had `system:admin-access` hand-granted to division roles (tests build clean roles, so tests pass while the panel misbehaves). The 30s `loadUserPermissions` cache is per-user-id and safe, but remember it exists when editing role data.
|
||||
- PATCHing a document that is open in someone's admin edit tab returns **423 Locked** (Payload document locks). Test with a different document or wait for the lock to clear.
|
||||
- For replaying admin-panel requests from the terminal: `/api/access` returns the caller's resolved permission map (collection `read` results are either a bare boolean like `true` or `{ permission, where }`; handle both shapes), and an officer-grade JWT can be crafted exactly like the impersonation route does (add a session `sid` to the target user, then `jwtSign` with `getFieldsToSign`).
|
||||
|
|
|
|||
Loading…
Reference in a new issue