Skip to content

fix(deps): bump the Payload family to 3.90.2 for scoped bookkeeping validation - #865

Merged
Ardnived merged 3 commits into
mainfrom
claude/upgrade-payload-3.90-852
Sep 29, 2026
Merged

Ardnived merged 3 commits into
mainfrom
claude/upgrade-payload-3.90-852

Conversation

@Ardnived

@Ardnived Ardnived commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Bumps the Payload family 3.87.1 → 3.90.2 (and Lexical 0.41.0 → 0.50.0, which [email protected] requires). Follows chore(events): decide whether the unpublishAllLocales validation skip stays #852's Option 2 finding.
  • The reason for chore(events): decide whether the unpublishAllLocales validation skip stays #852: under unpublishAllLocales, 3.90 validates the fields a write submits and skips only the stored rest (shouldLimitValidationToSubmittedFields / fieldsToValidate). updateEventBookkeeping keeps its one call unchanged, but a bad bookkeeping value is now refused instead of written unchecked. A new int case pins that.
  • 3.90.0 was a security release. Its apiKey hardening lands here as intended: no read returns a stored key any more. Clients now sets useAPIKey: { reveal: true }, so managers keep a Reveal button in the built-in admin UI, backed by Payload's gated endpoint.
  • Three other upgrade breakages are fixed: a hook-ordering race that failed every auto-slugging Region create, video fixtures Payload's new container sniffing rejects, and two Lexical fixtures the relationship feature now refuses at write time.
  • Two migrations: managers.reset_password_requested_at, a new Payload auth column, and _objectkey on the eight storage collections — which only appeared once the preview's smoke run failed (see Notes).

Changes

  • package.json, pnpm-lock.yaml — the whole Payload family to exact 3.90.2, lexical and @lexical/* to 0.50.0. @payloadcms/[email protected] still pins [email protected], so patches/[email protected] still applies.
  • src/migrations/20260929_041116_payload_3_90_auth_fields.{ts,json} — adds nullable reset_password_requested_at to managers. One additive column; no earlier migration adds it.
  • src/migrations/20260929_043344_storage_object_key.{ts,json} — adds nullable _objectkey to images, frames, videos, files, meditations (+ _meditations_v), songs, user_choices, song_tags.
  • src/plugins/storage/storagePlugin.ts — declares _objectKey on every storage collection in all three branches (enabled, no credentials, E2E), and builds the enabled collections map from one STORAGE_BACKENDS registry so the two can't drift.
  • src/payload-types.ts — regenerated: resetPasswordRequestedAt on Manager, virtual hasAPIKey on Client, and a polymorphic user on TaskSchedulePublish.
  • src/lib/events/updateEventWithoutValidation.ts — the docblock now describes 3.90's scoped validation instead of a full skip. The quoted Payload source it cited no longer exists.
  • src/collections/Regions/nonEmptySlug.ts, Regions.ts — withNonEmptySlug(inner, useAsSlug). On create, a blank slug is judged by siblingData.name rather than by whether the sibling checkbox's generator has run yet (see Notes).
  • src/collections/Clients/Clients.ts — useAPIKey: { reveal: true }.
  • docs/rules/access.md, docs/rules/api-clients.md — the apiKey field lock is now the last gate on reveal and the whole gate on a client choosing its own key. Payload itself closes the read.
  • Tests:
    • tests/int/clients-access.int.spec.ts — key read-back goes through POST /:id/api-key/reveal. Three new cases pin its gates: a listed manager gets the key with Cache-Control: no-store, an unlisted manager is refused, and a client key is refused 403 even for its own row.
    • tests/int/expire-events.int.spec.ts — a bookkeeping write on an event with invalid stored data still goes through, but an invalid verificationStage is refused.
    • tests/int/pages.int.spec.ts, lessons.int.spec.ts — the stale relationship node is planted through payload.db (the only way legacy data arises now), with a guard asserting the planted row really holds it.
    • tests/int/storage-utils.int.spec.ts — storageFilePath, now a required HandleUpload argument. Our adapters don't read it.
    • tests/utils/testData.ts — createVideo, createFile, createFrame pass a real Buffer.
    • tests/unit/region-non-empty-slug.spec.ts — covers the siblingData branch.

Test results

  • Lean gate: ✓ lint, tsc (src + tests), 2243 unit tests (+3 in tests/unit/storage-object-key.spec.ts)
  • Full pnpm test:int locally: ✓ 88 files, 1472 tests (run twice — the first surfaced the createFile/createFrame video fixtures)
  • pnpm generate:importmap — no changes. pnpm generate:types — the diff above only.

Watched red before the fix, on 3.90.2:

Without Red
The nonEmptySlug change Every createRegion call — 33 of the 42 cases in the three specs #852 names (The following field is invalid: Slug)
The Buffer fixtures collections-smoke videos, frames-by-narrator, cleanup-orphaned-media (header.readUInt32BE is not a function)
The payload.db planting pages / lessons stale-relationship cases (invalid: Content > Content)
The afterRead strip on Pages, with the new planting expected [ { type: 'relationship', … } ] to deeply equal [] — so the spec is not vacuous

The Region fix was also checked against 3.87.1: the same spec passes there unmodified, so the race flipped with the upgrade and was not latent.

Notes for reviewer

The first smoke run failed on column images._objectkey does not exist, and nothing local could have caught it. plugin-cloud-storage 3.90 stores an _objectKey column on every collection it manages — but only when enabled, and storagePlugin disables it wherever the Cloudflare credentials are absent: local dev, the integration suite (whose harness doesn't load it at all), and migrate:create. Before 3.90 the plugin added no stored column here, so that never mattered. storagePlugin now declares the field whatever the credentials; an enabled plugin swaps in its own identical definition. storage-object-key.spec.ts stubs the credentials and pins that both branches produce the same field — red on all three cases with the fix reverted. And re-running migrate:create with stubbed credentials (plugin enabled, as on Railway) now finds nothing to migrate. It's a second migration rather than a regenerated first one because the first already deployed to this preview (src/migrations/AGENTS.md, "Unmerged does not mean unapplied").

The Region slug race is Payload's, and it is not new — only who wins it is. slugField puts the generateSlug checkbox and the slug text field in one row, and traverseFields runs a row's fields through one Promise.all. The generator (the checkbox's beforeChange hook) used to finish before the text field's validate; on 3.90.2 it doesn't, so value arrives undefined on every create. Reading siblingData.name removes the dependency on order entirely. slugField is marked @experimental upstream.

reveal: true is a choice, and a one-line revert. Without it the built-in UI shows a key once, at generation ("It will not be displayed again"), and a lost key means regenerating it — breaking whichever host embeds it, including the 13 WordPress sites. With it, reveal requires admin access, then update on the row, then Clients.apiKey's own update lock. Nothing in src/ read a client's apiKey back, so the admin UI is the only surface affected.

The version-row overwrite (#841) and the localizeStatus hazard survive the upgrade. saveVersion({ unpublish }) still overwrites latest: true. The unpublish half is still inert only because Events omits versions.drafts.localizeStatus, and event-localize-status-guard.spec.ts still pins that. payloadcms/payload#18375 stays open: 3.90 scopes validation only behind unpublishAllLocales or trash, not as an option on an ordinary update.

Deployment

Both migrations apply in-process on boot, like every other. No operator step.

Closes #852

🤖 Generated with Claude Code

…alidation

Under `unpublishAllLocales`, 3.90 validates the fields a write submits and
skips only the stored rest, so `updateEventBookkeeping` now refuses a bad
bookkeeping value instead of writing it unchecked (#852). The same release
strips stored API keys from every read; `Clients` enables Payload's gated
reveal so managers keep the built-in Reveal button.

Also fixes what the upgrade broke: the Region slug generator losing its
race against the sibling validator, video fixtures the new container sniffing
rejects, and Lexical fixtures the relationship feature now refuses at write
time. Adds the `managers.reset_password_requested_at` auth column.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-865 September 29, 2026 04:15 Destroyed
@railway-app

railway-app Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-865 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Sep 29, 2026 at 4:38 am UTC
1 service not affected by this PR
  • mailpit

…e it

plugin-cloud-storage 3.90 stores an `_objectKey` column on every collection
it manages, but only when enabled — and it is disabled wherever the
Cloudflare credentials are absent, including `migrate:create`. The first
3.90 migration therefore missed it, and every upload on the preview failed
with `column images._objectkey does not exist`.

`storagePlugin` now declares the field in every branch, derives the enabled
map from the same registry, and a unit spec pins that both branches yield
the same column. Stacked as a second migration because the first has
already deployed to the preview.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-865 September 29, 2026 04:35 Destroyed

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-865 — 808c17c3 Deployed Sep 29, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

chore(events): decide whether the unpublishAllLocales validation skip stays

1 participant