Skip to content

fix(channels): unbreak unit-tests slug-lookup guard after PR #2151 - #2152

Merged
jung-thomas merged 1 commit into
DEVfrom
fix/slug-guard-channels-collections
Sep 4, 2026
Merged

fix(channels): unbreak unit-tests slug-lookup guard after PR #2151#2152
jung-thomas merged 1 commit into
DEVfrom
fix/slug-guard-channels-collections

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

The unit tests CI job (Static build guards → check-slug-lookups.ts) went red on DEV after PR #2151 (channels-p2-collections) merged:

[check-slug-lookups] FAILED — 1 unmarked direct slug lookup(s):
  srv/lib/channels/seed-collections.js:78
    const existing = await db.run(SELECT.one.from(ChannelCollections).where({ slug: d.slug }));

Fix

draftCollections() already canonicalizes the slug at source (slug: String(d.slug).toLowerCase()), and both this lookup and the subsequent INSERT reuse that same d.slug. So the value is write-path-canonical — the correct fix is the guard marker, not a redundant .toLowerCase().

Added: // slug-canonical: write-path-canonicalizes — draftCollections() lowercases d.slug at source

Verification

npx tsx scripts/check-slug-lookups.tsOK — 113 lookup(s) inspected; 68 marked ..., exit 0.

Note: the sibling Deploy Docs failure (missing channels sidebar entry) was already fixed on DEV in a later commit — no action needed there.

…eak unit-tests guard

draftCollections() already lowercases d.slug at source, so the
SELECT.one.where({ slug: d.slug }) lookup is write-path-canonical.
Add the slug-canonical marker so check-slug-lookups.ts passes (it
was failing the 'unit tests' CI job after PR #2151).
@jung-thomas
jung-thomas merged commit 8d9d4ae into DEV Sep 4, 2026
4 checks passed
@jung-thomas
jung-thomas deleted the fix/slug-guard-channels-collections branch September 4, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant