Skip to content

fix(ui): preserve nested ui path segments - #2119

Merged
c-thiel merged 1 commit into
lakekeeper:mainfrom
sivakumar-mahalingam:fix/ui-static-path-prefix
Oct 14, 2026
Merged

c-thiel merged 1 commit into
lakekeeper:mainfrom
sivakumar-mahalingam:fix/ui-static-path-prefix

Conversation

@sivakumar-mahalingam

@sivakumar-mahalingam sivakumar-mahalingam commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Strip only the leading ui/ prefix when resolving UI static asset paths.

The previous implementation removed every occurrence of ui/, which could map a malformed or nested path to a different existing asset. For example, /ui/duckdb/ui/duckdb-eh.wasm incorrectly resolved to duckdb/duckdb-eh.wasm.

Testing

Added a regression test verifying that:

  • /ui/duckdb/duckdb-eh.wasm returns 200 OK.
  • /ui/duckdb/ui/duckdb-eh.wasm returns 404 Not Found.

Closes #2118

Summary by CodeRabbit

  • Bug Fixes
    • Corrected UI asset path resolution. The ui/ prefix is removed only when it appears at the start of a path, allowing embedded assets with that prefix to load correctly. Any later ui/ segment remains part of the asset path and is not treated as a prefix, so the request returns not found.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d4d260ee-5831-4264-9579-bd956f6be840
📥 Commits

Reviewing files that changed from the base of the PR and between b3671be and d6717ee.

📒 Files selected for processing (1)
  • crates/lakekeeper-bin/src/ui.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Walkthrough

The UI static asset handler now strips ui/ only at the start of the path. Tests verify that a valid DuckDB asset path returns 200 OK and a path with a nested ui/ segment returns 404 Not Found.

Changes

UI static asset path handling

Layer / File(s) Summary
Path normalization and validation
crates/lakekeeper-bin/src/ui.rs
The handler removes only the leading ui/ prefix and passes the borrowed path to cache lookup and response conversion. Tests cover valid and nested-ui/ asset paths.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: c-thiel

Merge Risk: ⚪ Minimal · up to d6717

Valid UI asset paths are preserved while nested ui/ paths no longer alias existing assets. No actionable merge risk is established by the supplied context.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: preserving nested ui path segments during UI asset resolution.
Linked Issues check Passed The change satisfies issue #2118. static_handler uses strip_prefix("ui/"), so it removes only the leading route prefix. The nested ui/ segment remains in the lookup path. The regression test ver…
Out of Scope Changes check Passed The diff changes only UI static asset path handling, related borrowed-path handling, a function comment, and the regression test. These changes directly support issue #2118. No unrelated change is sho…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the paths at night,
One prefix leaves the route just right.
A nested ui/ will not be found,
A clear 404 comes back around.
The valid asset loads in flight.
Soft paws approve the fix outright.

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Title Formatted Correctly

The title of this PR match the correct format. Thank you!

@c-thiel c-thiel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch, thanks @sivakumar-mahalingam

@c-thiel
c-thiel merged commit afed1cd into lakekeeper:main Oct 14, 2026
69 of 70 checks passed
brgr-s pushed a commit that referenced this pull request Oct 15, 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.

UI static asset handler removes nested ui/ path segments

2 participants