Skip to content

fix(admin): staging publish and page-comment routes were shadowed by their wildcard - #19

Closed
zumbrunn wants to merge 3 commits into
feat/capabilitiesfrom
fix/staging-publish-route
Closed

zumbrunn wants to merge 3 commits into
feat/capabilitiesfrom
fix/staging-publish-route

Conversation

@zumbrunn

@zumbrunn zumbrunn commented Nov 5, 2026

Copy link
Copy Markdown
Member

Fixes #18.

comparePatterns in the manifest generator sorted /api/staging/:path* ahead of /api/staging/:path*/publish, so the greedy wildcard won. Publishing a staged draft ran the upsert handler and 500ed. /api/pages/:path*/comments, .../comments/:id and .../comments/:id/resolve had the same problem.

Staging is a live, documented feature (README, config, core staging engine), so I fixed the ordering instead of removing the route. Routes with more segments after a shared wildcard now register first; no route shapes changed.

  • tests/admin/staging_publish_test.ts: stages a draft and publishes it over HTTP, then checks the page file, onPageUpdate and that the draft is consumed. Fails with the original 500 on the old manifest.
  • tests/admin/manifest_test.ts: ordering assertions for staging and comments.
  • Full tests/admin suite: 268 passed.

Based on feat/capabilities (PR #17) because publish.ts there already fires onPageUpdate; retarget to main after #17 merges.

🤖 Generated with Claude Code

zumbrunn and others added 3 commits November 5, 2026 20:47
Restore, staging publish, translate x2, dev apply, reorder (new onPageMove) and
collab auto-save wrote pages and fired nothing. They now share
announcePageEvent(), which fires the hook and the content webhooks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The manifest generator put /api/staging/:path* ahead of
/api/staging/:path*/publish, so publish was unreachable (the upsert handler
ran and 500ed). Same for the page comments routes. Routes with more segments
after a shared wildcard now sort first.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
zumbrunn added a commit that referenced this pull request Nov 10, 2026
…#26)

Lands the whole 4.0 stack as one change; the intermediate commits only type-check against the final contract.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@zumbrunn

Copy link
Copy Markdown
Member Author

Landed in 4.0.0 as part of #26 (one squash of the whole stack: its intermediate commits only type-check against the final contract). Verified against the published @dune/core 0.36.0 and @dune/testing 2.0.0.

@zumbrunn zumbrunn closed this Nov 10, 2026
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