Repository navigation
fix(pages)!: webUrl put a tag segment in a path no site serves - #786
Merged
Merged
Conversation
`Pages.buildPath` emitted `[locale, tag, slug]`, so a page tagged `wisdom` published `webUrl: https://…/wisdom/my-article`. Nothing serves that path. - **WeMeditateWeb** routes a page at exactly one segment. Its builder is `ROUTE_BUILDERS.pages = '/' + slug`, its matcher is `^/([^/]+)/?$`, and its own spec pins that a nested path does not match. Its sitemap publishes the same one-segment shape. - **The legacy Rails site** does not serve it either. Checked against production on 2026-09-15: `/wisdom` is a 404, articles live at `/articles/<slug>`, and `wisdom` appears only as `/inspiration/wisdom`, a category index. So a tagged page published a canonical that 404s, while an untagged page worked — which is why it survived: the failure is invisible unless the page happens to carry a tag. `tags` is optional, so both shapes are common. The path is now `[locale, slug]`. The two specs that pinned the tag segment asserted the defect, so they invert here; both were watched failing first. `livePreview.url` in the same file moves to `serverEnv`, so an unset base fails at boot instead of interpolating `undefined`. The `web:` base stays on raw `process.env` deliberately — it runs per read, and that late bind is what lets a spec stub it with `vi.stubEnv`; it already guards to `null` rather than producing a broken URL. Found while planning the cross-repo live-preview unification: the same `buildPath` is what the live-preview panel URL will be composed from, so the panel would have landed on those same 404s. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
railway-app
Bot
temporarily deployed
to
sahajcloud / SahajCloud-pr-786
September 15, 2026 01:30
Destroyed
|
🚅 Deployed to the SahajCloud-pr-786 environment in sahajcloud
1 service not affected by this PR
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A page tagged
wisdompublishedwebUrl: https://…/wisdom/my-article. No site serves that path — not the new one, not the old one. An untagged page worked, which is why this survived: the failure is only visible when a page happens to carry a tag, andtagsis optional.The evidence
/wisdom/<slug>?/<slug>—ROUTE_BUILDERS.pagesis'/' + slug, matcher is^/([^/]+)/?$, sitemap agrees/articles/<slug>;wisdomis only/inspiration/wisdom, a category indexSo
[locale, tag, slug]matched neither. The path is now[locale, slug].Changes
src/collections/Pages/Pages.ts— drop the tag segment frombuildPath.livePreview.urlmoves toserverEnv, so an unset base fails at boot rather than interpolatingundefinedinto the panel's URL. Theweb:base deliberately stays on rawprocess.env— it runs per read, and that late bind is what lets a spec stub it withvi.stubEnv. It already guards tonull, so it cannot produce a broken URL the way the preview builder could. (I switched it first, and six specs went red withhttp://localhost:5173— worth knowing before someone "tidies" it again.)tests/int/pages.int.spec.ts— the two cases that pinned the tag segment were asserting the defect, so they invert. Both watched failing first.Test results
pnpm lint,pnpm typecheck,pnpm test:unit(2017) — greenpages,pages-localize-status,client-canonical,collections-smoke— 87 passedNotes for reviewer
Marked
!becausewebUrl/webPathare a published API surface and a tagged page's value changes shape. It changes from a URL that 404s to one that resolves, so I read this as a fix rather than a break — but it is a live field, and worth a second opinion on whether any consumer had adapted to the old shape. The only in-repo consumers ofwebPath/webUrlare the atlas sitemap and SEO endpoints, which read regions and events, never pages; a code search across both client repos finds pagewebUrlunused.Found while planning the cross-repo live-preview unification. That work composes the live-preview panel URL from this same
buildPath, so without this the panel would have landed on those same 404s for every tagged page.🤖 Generated with Claude Code