Skip to content

[server] Fix studio rewrite #1926 - #1927

Merged
michaelvlach merged 2 commits into
mainfrom
1926-server-fix-studio-rewrite
Sep 11, 2026
Merged

michaelvlach merged 2 commits into
mainfrom
1926-server-fix-studio-rewrite

Conversation

@michaelvlach

Copy link
Copy Markdown
Collaborator

No description provided.

@michaelvlach
michaelvlach requested review from agnesoft and a lite review from Copilot September 11, 2026 16:12
@michaelvlach michaelvlach linked an issue Sep 11, 2026 that may be closed by this pull request
@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agdb Ready Ready Preview Sep 11, 2026 5:11pm UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is small, targeted, and backed by a regression test, with only a minor test-failure logging/coverage nit noted.

Pull request overview

This PR fixes Agdb Studio asset URL rewriting when the server is configured with a non-empty basepath, ensuring Studio’s bundled JS uses basepath-prefixed /studio URLs (including template-literal occurrences), and adds a regression test to cover the scenario.

Changes:

  • Extend Studio index JS rewriting to also handle template-literal paths (`/studio`) when config.basepath is set.
  • Add an integration test that validates the served Studio HTML and JS reflect the configured basepath.
File summaries
File Description
agdb_server/src/routes/studio.rs Adds basepath rewriting for template-literal \/studio` occurrences in the served index JS bundle.
agdb_server/tests/routes/misc_routes.rs Adds a studio basepath rewrite regression test that fetches Studio HTML, extracts the bundle path, and validates rewritten URLs in the JS.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread agdb_server/tests/routes/misc_routes.rs Outdated
The basepath rewrite logic in studio.rs was missing a case for single-quoted `/studio` string literals. Added handling for `'/studio` alongside the existing double-quote and backtick cases.

The test is also improved to check all three quote styles and report the offending snippet on failure.
@michaelvlach
michaelvlach merged commit 170b956 into main Sep 11, 2026
9 checks passed
@michaelvlach
michaelvlach deleted the 1926-server-fix-studio-rewrite branch September 11, 2026 17:16
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.

[server] Fix studio rewrite

3 participants