mirror of
https://github.com/payloadcms/payload.git
synced 2026-09-14 20:07:19 +08:00
42e5ccfa89
Addresses review feedback on the update path. Adds the requested test: create two source-less drafts, then update both, confirming they still coexist under the unique index. The accompanying code change was not needed. The update branch's `null` is inert — it never reaches storage on any adapter. Verified by inspecting the raw main and version documents on Mongo after an autosave update: the slug key is absent, not null, so the sparse index never sees a null to collide on. The same holds at the API level on Postgres and SQLite. Reworded the create-branch comment, which claimed to mirror "the `null` the update branch falls back to". That framing was misleading given the above, and it omitted the actual reason for `undefined`: Mongo's sparse index does include `null`, so `null` would fix Postgres alone. Renamed three tests from "leave the slug null" to "leave the slug absent" to match what is really stored.