Sasha Rakhmatulin
42e5ccfa89
chore: cover empty-slug autosave updates and clarify the create comment
...
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.
2026-09-10 15:31:03 +01:00
..
2026-07-28 16:27:56 -04:00
2026-04-09 14:32:01 +01:00
2026-03-20 15:16:39 -07:00
2026-08-11 13:42:47 -07:00
2026-08-18 15:32:34 -04:00
2026-04-17 15:56:08 +00:00
2026-04-17 15:56:08 +00:00
2026-06-17 16:30:08 +00:00
2026-03-25 18:41:41 +00:00
2026-02-03 17:22:39 +00:00
2026-04-17 15:56:08 +00:00
2026-01-30 14:05:01 -05:00
2026-07-29 10:20:55 -07:00
2026-02-03 17:22:39 +00:00
2026-07-06 09:21:47 +00:00
2026-02-03 17:22:39 +00:00
2025-12-19 16:07:14 -05:00
2026-04-09 14:32:01 +01:00
2026-03-02 18:50:59 +00:00
2026-09-02 15:43:35 +00:00
2026-02-03 17:22:39 +00:00
2026-01-30 14:05:01 -05:00
2026-04-17 19:13:08 +00:00
2026-01-30 14:05:01 -05:00
2026-02-03 17:22:39 +00:00
2026-03-30 18:45:24 +01:00
2026-04-17 15:56:08 +00:00
2026-02-03 17:22:39 +00:00
2026-01-30 14:05:01 -05:00
2026-09-10 15:31:03 +01:00
2026-06-12 13:05:53 +00:00
2026-07-28 16:27:56 -04:00
2026-02-03 17:22:39 +00:00
2026-08-18 15:32:34 -04:00
2026-04-02 20:15:02 +01:00
2026-07-08 11:56:35 +00:00
2026-01-30 14:05:01 -05:00
2026-02-20 12:59:43 +00:00
2026-02-03 17:22:39 +00:00
2026-02-03 17:22:39 +00:00
2026-08-17 13:19:35 +01:00
2026-02-03 17:22:39 +00:00
2026-08-05 09:44:56 -04:00
2026-04-17 15:56:08 +00:00
2026-07-07 08:57:48 +01:00
2025-12-19 16:07:14 -05:00
2026-07-31 15:50:56 +00:00
2026-01-30 14:05:01 -05:00
2026-04-01 17:15:30 +01:00
2026-03-17 00:20:42 +00:00
2026-02-03 17:22:39 +00:00
2026-01-30 14:05:01 -05:00
2026-01-30 14:05:01 -05:00
2026-02-10 08:36:42 -05:00
2026-05-20 08:46:21 -04:00
2026-04-20 15:19:03 +01:00
2026-08-14 12:40:30 +00:00
2026-08-11 13:42:47 -07:00
2026-08-11 20:09:34 +00:00
2026-08-11 13:42:47 -07:00
2026-07-09 12:58:33 +00:00
2026-02-03 17:22:39 +00:00
2026-04-11 01:41:37 +00:00
2026-04-17 15:56:08 +00:00
2026-03-19 11:21:02 -04:00
2026-02-03 17:22:39 +00:00
2026-04-14 09:27:46 -07:00
2026-02-20 12:59:43 +00:00
2026-08-26 16:05:46 -04:00
2026-06-17 09:29:07 +01:00
2026-07-06 09:48:58 +00:00
2026-04-17 15:56:08 +00:00
2026-02-03 17:22:39 +00:00
2026-04-17 15:56:08 +00:00
2026-06-11 17:58:08 +01:00
2026-07-14 16:03:03 +01:00
2026-01-30 14:05:01 -05:00
2026-02-18 18:46:49 +00:00
2026-06-24 13:33:12 -07:00
2026-01-30 14:05:01 -05:00
2026-04-16 18:16:47 +00:00
2026-08-14 19:00:49 +00:00
2026-04-01 13:39:46 +00:00
2026-07-30 15:30:02 -04:00
2026-04-09 14:32:01 +01:00
2026-09-03 17:54:43 +00:00
2026-02-03 17:22:39 +00:00
2026-04-17 15:56:08 +00:00
2026-07-01 09:03:15 -04:00
2026-02-03 17:22:39 +00:00
2026-04-09 14:32:01 +01:00
2026-03-10 17:07:58 -04:00
2026-02-03 17:22:39 +00:00
2025-03-05 19:14:35 +00:00
2026-06-16 16:26:03 +00:00
2026-02-03 17:22:39 +00:00
2026-03-26 13:17:41 -04:00
2026-08-25 15:59:57 -04:00
2026-05-07 12:37:09 -04:00
2026-07-01 13:42:19 -07:00
2026-04-17 15:56:08 +00:00
2025-07-18 06:48:27 -04:00
2026-04-13 15:39:33 +00:00
2026-07-01 13:42:19 -07:00
2025-05-12 09:41:18 -04:00
2026-03-03 15:55:53 +00:00
2026-02-27 14:15:12 -05:00
2025-09-29 20:05:16 -04:00
2025-12-23 11:54:25 -05:00