Skip to content

fix(fields): a blank slug is NULL on an unpublished page, '' on the home page, refused elsewhere - #1041

Merged
Ardnived merged 20 commits into
mainfrom
claude/fix-1038-blank-draft-slug
Oct 30, 2026
Merged

Ardnived merged 20 commits into
mainfrom
claude/fix-1038-blank-draft-slug

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Change outline

Flow — the slug-generation hooks, per write

The factory puts one hook on each side of Payload's own generateSlug, the checkbox field's beforeChange hook. It judges the slug the generator leaves, rather than predicting it.

 slugField({ blankAllowed? })                         src/fields/slugField.ts
   generateSlug checkbox → hooks.beforeChange
+    nullOnDrafts                                     # collection has drafts and slug is blank → NULL
+                                                     #   (so autosave doesn't read '' vs a stored NULL as an override)
     …Payload's generateSlug                          # unchanged: fills slug from the source
+    settleBlank                                      # slug still blank after generation:
+      blankAllowed(doc)            → ''              #   pages: the wm-web-config home page
+      drafts, not yet live (published row, draft: false, any locale):
+        usable title               → slugify(title)  #   whatever the generateSlug checkbox says
+        else, this write unpublished → NULL          #   untitled drafts; the column is nullable there
+      otherwise                    → ValidationError 400 on `slug`   # a live page's URL is never renamed
   slugify: slugifyValue(valueToSlugify)              # main's, unchanged (#1038's override is gone)

What each collection now does with a blank:

 pages, the home page (wm-web-config.homePage)  → keeps ''
 pages, live in any locale                      → refused with a 400, never renamed
 pages, not yet live, with a usable title       → filled from the title, even on the publishing write
 pages, not yet live, no usable title           → NULL (untitled drafts never collide), refused if this write publishes
 authors, song-tags, user-choices, regions      → refused, a stored '' included

Files — the regions-only validator folds into the factory

 src/collections/Regions/
-├── nonEmptySlug.ts        # withNonEmptySlug: refused a newly blank region slug, grandfathered a stored one
 └── Regions.ts             # slugField(); the checkbox default-off override stays

Contract — the stored rows

-- src/migrations/20261027_190500_pages_blank_slug_to_null.ts
UPDATE "pages" SET "slug" = NULL WHERE "slug" = '' AND "id" IS DISTINCT FROM <home_page_id>;
UPDATE "pages" SET "slug" = ''   WHERE "slug" IS NULL AND "id" = <home_page_id>;

Preview

Both links need a sign-in; the repo guide's Railway row covers it (PREVIEW_ADMIN_EMAIL).

  • Pages list: press Create, then Generate in the sidebar before typing a title, wait for the autosave, then Create again. Each opens its own editor at /admin/collections/pages/<id>. On main the second one renders the admin chrome with an empty body.
  • Authors list: create an author with a name, then unlock the slug, clear it and save. The save is refused on the slug field; on main it stores the blank.

Data: not seeded, and none is needed. Both flows create their own rows. previewUrl.seed is unset for this repo.

Contract impact

WeMeditateWeb (read only here, no change needed):

  • It reads the home page's per-locale status with where[slug][equals]=<homePage.slug>.
  • An empty value there matches '' alone. I measured this over REST in the int lane: a NULL slug returns 0 docs, '' returns the home page.
  • So the home page must keep ''. The previous version of this PR turned it into NULL, which would silently have dropped /'s hreflang cluster.
  • With '' kept, /, /:slug and the sitemap behave exactly as before. The contract is recorded in src/globals/AGENTS.md.

Migration

  • New migration: src/migrations/20261027_190500_pages_blank_slug_to_null.ts
  • Impact: pages.slug blank values only. No column, index or type changes, and no non-blank slug is touched.
    • An unpublished non-home '' becomes NULL.
    • A NULL home page becomes '', but only if no other row holds it.
    • A published page is never nulled. It is left as it is and named in a warning, to be given a slug by hand.
    • A home page left NULL is named in a warning too.
  • Production impact: none expected. Its one blank row is the home page (id 1, ''), which already has the target shape.
  • _pages_v is left alone: restoring a version runs the same hooks.
  • Replayed through up() on a scratch Postgres in four shapes:
    • Production's: a no-op.
    • A NULL home page plus a draft page's '': the home page becomes '', the draft NULL.
    • A published page holding '': it is kept, and both warnings fire.
    • No global row: the blank becomes NULL.
  • Reversible: no. down() is a no-op, because writing '' back to more than one row would break the unique index.

Test results

  • Lean gate: ✓ lint, Prettier, tsc over src/, tsc over tests/, 232 unit files / 2945 tests (after merging main)
  • Targeted specs, all green:
    • slug-field-posted-blank (20 cases)
    • pages
    • pages-localize-status
    • collections-smoke
    • regions
    • region-canonical-url
    • region-breadcrumb-url-backfill
    • atlas-collections
    • globals-client-reads
    • wemeditateAppStatus
    • content-index-block
    • wm-app-config
    • app-cards-for-audience
    • client-query-validation
    • role-based-access
    • manager-invite
    • schema-utils
    • cleanup-orphaned-media
    • user-choices
    • user-choices-by-timing
    • meditation-songs
    • api
    • seeds/tests/atlas-translations-import
  • Build: N/A. Railway builds the app on the preview deploy.

Each new assertion was first watched failing:

  • Against the PR's original head (04ff8cb): the posted-blank and generated-blank cases fail. They store '', or a posted null reaches Postgres as a DrizzleQueryError.
  • Against the previous push (3190713): the five home-page and published-page cases fail. Those are the published refusal for '' and for null, the home page keeping '' and turning a posted NULL into '', and an author's stored '' being refused.
  • Against the commit before the any-locale fix: the cross-locale case fails, because a de write cleared the slug of a page live in en.
  • Against abe9a193: three cases fail. They are the regenerate-from-title case, "refuses clearing the slug of a live page through a newer draft" (the live check read the latest draft), and "publishes an untitled draft once titled, however many times it was saved" (a stored generateSlug: false left it refused).
  • Against the interim fill-everywhere draft: the four live-page cases fail, because it renamed a live URL instead of refusing.
  • A mutation that reads siblingDocWithLocales again fails the newer-draft case.
  • Two cases are guards that pass on the older code too: "regenerates from the name when the generator is switched on" fails under a mutation that judges the posted value, and the home-page-with-generator-on case pins behaviour that already held.
  • The stored-blank region case (a whole-document re-save, as the nested-docs cascade does) fails with the regions grandfather restored.

Manual verification

  1. On the preview, follow the Pages link above: Create, then Generate before typing a title, wait for the autosave, then Create again. The second Create must open its own editor.
  2. Give one of those drafts a title and publish. Then clear its slug and publish again: the publish is refused on the slug field.
  3. On the preview: PATCH /api/authors/<id> with {"slug":""} answers 400 on slug, not 5xx. POST /api/authors with {"name":"Grounding Check"} answers 201 with a generated slug.
  4. After this merges and deploys: GET /api/pages?where[slug][equals]=&trash=true&draft=true must return exactly the home page. On WeMeditateWeb, / must still emit its hreflang alternates.

Notes for reviewer

  • The home page keeps '': option A, chosen by the owner over a real slug (e.g. home). A real slug would expose /home through the '/' + slug builders in both repos:

    • SahajCloud: webPath/webUrl would advertise …/home. Live preview would load /home, which WeMeditateWeb 302s to /, dropping the preview token.
    • WeMeditateWeb origin/main: ROUTE_BUILDERS.pages in lib/document-routes.ts, partitionPublishedPages, and the nav and footer builders render '/' + slug. So any rich-text link, card or nav entry that references the home document would link /home (a redirect), where today it is dropped.
    • The hreflang read and the sitemap would keep working, the sitemap better.
  • A page not yet live is filled from its title, whatever generateSlug says. Payload stores the checkbox false on a publish, on a posted slug, and once a draft passes two versions, and a non-admin can reset neither it nor the slug. A live page's cleared slug is refused instead, because renaming a live URL silently is worse.

  • On "make slug required so it refuses NULL, and give the home page the blank slug": built, with one finding that changes its shape.

    • Payload's postgres adapter drops NOT NULL on every column of a collection with drafts, and pages.slug is already required: true. So the column itself cannot refuse NULL.
    • The hooks refuse it instead, for a page published in any locale.
    • An unpublished draft still gets NULL. Refusing it there would reopen fix(fields): an untitled draft gets slug '' and blocks every new Page #1038: the Create view autosaves an untitled draft before it redirects.
  • The home page is identified by wm-web-config.homePage. A blank-slug pages write reads that global once, with select: { homePage: true }. Nothing moves '' when homePage changes: the new home page's blank is refused as "Value must be unique" until the old home page's slug is cleared or set. That is documented in src/globals/AGENTS.md.

  • A page published in any locale counts as published, because the slug is not localized. One consequence: an autosave that clears the slug of a published page is refused, not just its publish.

  • authors, song-tags and user-choices refuse every blank, a stored one included. That is the owner's ruling: production holds no such rows.

  • Regions refuse every blank too, a stored one included. Production holds 0 of 646 regions with a blank slug (read through the Atlas client key), so the cascade grandfather, and region-blank-slug-cascade which existed only for it, are gone. scripts/audit-region-slugs.ts stays: a blank region would now refuse every save that cascades into it.

  • withNonEmptySlug is deleted, although fix(fields): a posted blank slug is stored, not refused or nulled #1040 said to keep it. Its own message could never show, its one stricter case protected nothing, and its grandfathering is no longer needed.

  • tests/unit/slug-field-blank-source.spec.ts is deleted with the slugify override it pinned. The pages int cases now hold its guarantee.

  • One cost of throwing from a hook: it ends the save before Payload raises the other fields' collected errors. An authors create with a blank name reports only the slug, with a message that names the field it is generated from.

  • fix(fields): a posted blank slug is stored, not refused or nulled #1040's ⚠ about the validator and the generator seeing different data does not hold on 3.90.2. beforeValidate fills every omitted field from the stored document before either runs.

Local review

Three fresh critic passes. Each was given the tickets and the diff, not the implementer's reasoning.

Pass 1, on a predictive-validator design. Findings adopted, which led to the redesign above:

  • A draft save then a publish cleared a real slug without any refusal.
  • A region name that transliterates to nothing (東京) still stored ''.
  • The validator copied generateSlug's rules and drifted from them: a rename with the checkbox on, and a pages draft titled 東京.
  • One assertion couldn't fail.
  • Two comments made claims that were no longer true.

Pass 2, on the after-generation hooks. Adopted:

  • Two plain hooks instead of a .map wrapper.
  • Grandfather only an unchanged blank. The earlier rule let a posted null through to a 5xx.
  • Delete withNonEmptySlug.
  • Correct the stale migration comments and PR body.

Pass 3, on the home-page design. Adopted:

  • "Published" was judged in the request's locale only. A de write cleared the slug of a page live in en. It now counts any locale, and a case pins it.
  • The home page with generateSlug on (the column default) was untested. Now pinned.
  • The global read now selects homePage only.
  • The home contract is explained once, in src/globals/AGENTS.md, with the homePage-move caveat.
  • The stale region count is dropped from the comment, which points at the audit script instead.
  • This body was rewritten.

Pass 4, on the review's design-independent fixes. Adopted:

  • The source fill renamed a live page's slug when an admin cleared it, in any locale. It now fills only a page that is not yet live, and the live-page cases use real titles so they catch a rename.
  • The audit script claimed regions refill a blank slug. They do not: regions have no drafts. Corrected.
  • The migration could leave the home page NULL silently. It now warns.
  • The live read ran outside the write's transaction. It now joins it, on localeIsolatedReq(req), with trash: true.
  • The NOT NULL cases pin with usable names again that nothing is filled there.
  • The refusal message no longer suggests a missing source.

Dismissed, with reasons:

  • The migration is a no-op on production. It stays, as the user asked for the home row's migration, and it corrects any environment that holds a NULL home page or another page's ''.
  • "Set one" in the refusal can't be acted on by a non-admin, since slug updates are admin-only. Left: wording for that case is a copy decision.
  • The throw masking a blank source's own error: above.
  • The uniqueness validator's "500 → 400" comment predates this PR. Drizzle already maps 23505 to a 400.
Detail

Why the judgement sits after the generator, not in the slug field's validate. The slug's validator and the checkbox's generateSlug hook are separate promises in one Promise.all (payload/dist/fields/hooks/beforeChange/traverseFields.js). On 3.90.2 the validator reads the slug before the generator writes it. A validator therefore has to predict the generator, and that prediction drifts: 東京, a rename with the checkbox on, and autosave's override rule all broke one. A field's own hooks run in sequence, so a hook placed after generateSlug on the same field sees exactly what will be written.

Why NULL only on an unpublished pages draft. Payload's postgres adapter drops NOT NULL on every column of a collection with drafts (disableNotNull: !!collection.versions?.drafts), and draft saves skip validation. So that is the one place a NULL is storable and nothing else could refuse a blank. A published page has a public path to lose, so it is refused like any other collection.

Why nullOnDrafts also runs before the generator. generateSlug's autosave branch treats a posted slug that differs from the stored one as the user's own override. A posted '' against a stored NULL would then never regenerate from a title typed in the same save.

Why the _pages_v sweep went. Restoring a version runs these hooks, so a '' in history is settled on the way back. version_slug carries no unique index.

Rows the NOT NULL collections may already hold. On main, a source that transliterates to nothing (東京) could generate '' in authors, song_tags and user_choices. The owner confirmed production has none, so a stored '' there is refused on its next save rather than grandfathered.

Earlier review notes (#1038). Three reviewers suggested folding the second #1038 pages case into the first. Kept separate: it pins that a titled draft still generates its slug. One reviewer read tests/AGENTS.md's "do not test slug generation" as covering these specs. That rule is about Payload's internals; these assert our own hooks' interaction with them.

Closes #1038
Closes #1040

🤖 Generated with Claude Code

`pages` autosaves, so the admin Create view saves an empty draft on the
server before it redirects to it. Our slugify wrapper answered `''` for a
blank title, and `pages.slug` carries a unique index: Postgres admits any
number of NULLs under one but only a single `''`. One row holding `''` —
the Home Page — therefore refused every later Create, and the view
rendered its chrome with no body. No Page has been created since
2026-06-18.

Payload's own default slugify returns `undefined` for a blank source for
exactly this reason, so the wrapper now falls back to it.
`slugifyValue` still answers `''`, which the Atlas region seeder relies on
for its `||` fallback.

The migration clears the rows written before this. It sweeps `_pages_v`
too: restoring a version whose slug is `''` would write that value back
onto the row and re-arm the collision.

Refs #1038

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ6TUnympp7DH2V1gj
The first pass answered `undefined` whenever the slugified result was blank,
which is stricter than Payload's own default and stricter than #1038 needs.
A name like `東京` slugifies to `''` under any rule, and `authors`,
`song_tags`, `user_choices` and `regions` all declare `slug` NOT NULL — so
that row stopped being written at all and surfaced as a raw
DrizzleQueryError rather than the (wrong, but saved) row it stores today.
Reproduced in the integration lane before and after.

A blank *source* is the #1038 case and still answers `undefined`. That is
exact parity with Payload's default, and a unit spec pins both directions:
each half fails against the version it is there to catch.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ6TUnympp7DH2V1gj
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1041 October 27, 2026 19:43 Destroyed
@railway-app

railway-app Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Oct 30, 2026 at 6:19 pm UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 27, 2026
@sydevs-bot

sydevs-bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 18:42Z review-pr · attempt 2 · session · done
  • 18:42Z review-pr · attempt 2 · session
  • 13:18Z review-pr · attempt 1 · session · timed out
  • 13:18Z review-pr · attempt 1 · session
  • 06:11Z review-pr · attempt 2 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The diff is the right size for #1038: one line of behaviour, one data migration, two specs. It improves on the ticket — slugifyValue(x) || undefined would have nulled 東京 and broken the four NOT NULL collections, and commit 2 narrows it. The four doc edits are the spec count tests/PERF.md pins, so nothing is smuggled.

What does not hold up is the reasoning shipped as comments. Three claims are wrong or name the wrong guard, two of them in a migration and a field comment — the only record of why four collections were left alone. The behaviour is right; the explanation a reader inherits is not.

For #1040, not here: in authors, song_tags and user_choices the generator still answers '' for a source that transliterates to nothing, the uniqueness validate early-returns on it, and the second such row is a 5xx. Only option C's cost names this.

Findings

  • should-fix — slugField.ts:78: "exactly Payload's own default" is false for an empty-string source, the case the fix turns on.
  • should-fix — 20261027_190500_pages_blank_slug_to_null.ts:14: drafts are not what lets '' land, and NOT NULL does not stop ''.
  • consider — slugField.ts:83: re-argues a rejected alternative already in the PR body.

What was checked

  • #1038 vs the diff: all four criteria met. Step 2's ''-row check is the gap.
  • slugField.ts whole, plus Pages, Authors, SongTags, UserChoices, nonEmptySlug.ts.
  • Snapshot: pages.slug nullable + unique, _pages_v.version_slug nullable non-unique, the other four NOT NULL + unique — the only slug-bearing tables, and slug is unlocalized.
  • The .json is byte-identical to 20261027_000341's.
  • Payload's generateSlug.js: create ignores the checkbox, so the source's required guards.
  • Both ## Preview links answer 200; no PREVIEW_ADMIN_EMAIL, so no sign-in.
    🤖 Written by the sydevs autonomous loop — see what this is

Generated by Claude Code

Comment thread src/fields/slugField.ts Resolved
Comment thread src/fields/slugField.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 27, 2026
The slugify comment claimed exact parity with Payload's own default. It is
not parity for the case #1038 turns on: `payload/dist/utilities/slugify.js`
is `val?.trim()…`, so an empty-string source answers `''` there and
`undefined` here. Optional chaining short-circuits on nullish alone.

State what the override actually does — `undefined` for both nullish and
blank, Payload's `''` kept where a source merely transliterates to nothing.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVbC1PaTcTQJfidrq3
The comment said drafts are what skip "the field's own `required`". They
are not: `slugField` installs a uniqueness `validate` on all five slug
collections, and supplying one replaces Payload's default — the validator
that enforces `required`. `src/collections/Regions/nonEmptySlug.ts` already
documents that hole.

What keeps `''` out of authors, song_tags and user_choices is the SOURCE
field's `required`, which the factory never replaces, and drafts are the one
path past it. NOT NULL does not refuse `''` either, so a blank there would
be a row to fix rather than one that cannot exist.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVbC1PaTcTQJfidrq3
Why the rule is not in `slugifyValue` re-argues an alternative nobody
reading the file fresh is weighing — change context, which belongs in the
commit message and the PR body, both of which already carry it. The ⚠ block
above keeps the load-bearing fact.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVbC1PaTcTQJfidrq3
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1041 October 27, 2026 20:17 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Three critic threads, all adopted. Comments only — no behaviour changed, and the lean gate is green on 04ff8cb (234 files / 2958 tests).

The PR body carried the first two errors too, in ## Change outline and the step-2 note. Both corrected.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot added awaiting and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 27, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review October 27, 2026 20:33
@sydevs-bot
sydevs-bot requested a review from Ardnived October 27, 2026 20:33
@sydevs-bot
sydevs-bot enabled auto-merge October 27, 2026 20:33
@Ardnived Ardnived removed the awaiting label Oct 28, 2026
@Ardnived

Copy link
Copy Markdown
Contributor

@sydevs-bot Revise. Could we simplify things if we simply reject blank slugs?

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 29, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Oct 29, 2026
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 29, 2026
Ardnived and others added 3 commits October 29, 2026 18:37
Review findings on the home-page commit:

- "Published" was judged in the request's locale only, but the slug is
  not localized. A non-draft `de` write that cleared the slug of a page
  live in `en` stored NULL and took the `en` URL with it. A page now
  counts as published if any locale is.
- Nothing pinned the home page with `generateSlug` on, which is the
  column default. A case does now.
- The home read selects `homePage` only, and the contract is explained
  once, in `src/globals/AGENTS.md`, which now says nothing moves `''`
  when `homePage` changes.
- The regions comment drops a two-month-old row count and points at the
  audit script.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1041 October 30, 2026 01:40 Destroyed
@Ardnived Ardnived changed the title fix(fields): a blank slug is NULL on pages and refused elsewhere, never '' fix(fields): a blank slug is NULL on an unpublished page, '' on the home page, refused elsewhere Oct 30, 2026
Production holds 0 of 646 regions with a blank slug, read through the
Atlas client key. The exception that let a stored `''` re-save
unchanged, kept for the nested-docs cascade, now protects nothing.
Regions refuse every blank, as authors, song-tags and user-choices do,
and `blankAllowed` has one caller: the home page.

The cascade spec existed only for that exception, so it goes. The
blank-slug spec now pins that a stored blank region slug is refused even
when re-saved whole, which is what the cascade does to each descendant.
The audit script still says what a blank region costs, and two comments
lose a row count that is no longer true.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1041 October 30, 2026 01:53 Destroyed
…ive" by the published row

Review findings on #1041, fixed whatever the home-page decision:

- **A live page could lose its slug through a newer draft.** The "published
  in any locale" check read `siblingDocWithLocales._status`, which on a
  drafts update is the latest version. A published page with a newer
  draft therefore read as unpublished, and clearing its slug stored NULL.
  Whether a page is live is now read from the published row
  (`draft: false`), inside the write's transaction on a locale-isolated
  copy of `req`.
- **A titled page could be unable to publish.** Payload's generator stores
  `generateSlug: false` on a publish, on a posted slug, and once a draft
  passes two versions. A non-admin can reset neither that nor the slug,
  so an untitled draft given a title later was refused on publish. A page
  that is not yet live is now filled from a usable title, whatever the
  checkbox says. A live page's cleared slug, which is its public URL, is
  still refused in every locale and never renamed. The NOT NULL
  collections are not filled either.
- **The migration could null a published page.** It now leaves a
  published non-home `''` as it is and names it in the log. The home row
  takes `''` only if no other row holds it, and is named in the log if it
  cannot. Replayed through `up()` on a scratch database in four shapes.
- **The regions audit script states plainly** that production held none,
  and that a blank region refuses its next save, so every ancestor save
  then fails.

The refusal message no longer suggests a source the document already has.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1041 October 30, 2026 05:25 Destroyed
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 30, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

The session for this item did not finish after 3 attempts. I have stopped retrying. A mention (@sydevs-bot) or a push from you starts me again.

🤖 sydevs dispatcher

@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Oct 30, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 30, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Oct 30, 2026
…-draft-slug

# Conflicts:
#	AGENTS.md
#	docs/rules/testing-reqs.md
#	tests/AGENTS.md
#	tests/PERF.md
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1041 October 30, 2026 17:46 Destroyed
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1041 October 30, 2026 18:00 Destroyed
Since this branch, a page can't be published without a slug, and the slug
field refuses before title's own check runs, so the captured field path is
`slug`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1041 October 30, 2026 18:14 Destroyed
@Ardnived
Ardnived merged commit d9698fe into main Oct 30, 2026
9 checks passed
@Ardnived
Ardnived deleted the claude/fix-1038-blank-draft-slug branch October 30, 2026 18:24
@sydevs-bot sydevs-bot moved this from Working to Done in SYDevelopers Technical Roadmap Oct 30, 2026
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 30, 2026
@Ardnived Ardnived removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1041 — 79bff503 Deployed Oct 30, 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.

fix(fields): a posted blank slug is stored, not refused or nulled fix(fields): an untitled draft gets slug '' and blocks every new Page

3 participants