You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
schedulePublish task fails with "invalid relationships" on collections using @payloadcms/plugin-nested-docs breadcrumbs (Postgres, numeric IDs) #17229
After #10481 fixed job querying by always storing input.doc.value as a string, getSchedulePublishTask's handler still passes that string straight into payload.update({ id: input.doc.value, ... }) without coercing it back to the collection's real ID type. For plain collections this is harmless. But for a collection using @payloadcms/plugin-nested-docs, the plugin's beforeChange hook recomputes the breadcrumbs array on every update, and its self-referencing entry sets doc: currentDocument.id — which inherits that same string, since currentDocument.id = originalDoc?.id ?? data?.id traces back to the string id used in the update call.
That string then fails Payload's own relationship-field validator (fields/validations.js), which does a strict typeof value === 'number' check via isValidID() for numeric (Postgres default) ID types. The scheduled publish job errors out and never completes.
Confirmed via instrumentation (temporary console.logs, since removed):
Activity
fix: coerce schedulePublish doc.value to collection ID type before up…
fix: coerce schedulePublish doc.value to collection ID type before up…
github-actions commentedon Jul 10, 2026
🚀 This is included in version v3.86.0