feat(list): skip unaddressable keys (//, ., ..) from listings - #118
Draft
alukach wants to merge 1 commit into
Draft
feat(list): skip unaddressable keys (//, ., ..) from listings#118alukach wants to merge 1 commit into
alukach wants to merge 1 commit into
Conversation
Builds on the #116 LIST fix. That change stopped a single `//`-segment key from 503-ing an entire prefix, but it surfaced such keys in the listing even though they can't be fetched: `object_store::path::Path` rejects them and `validate_key` 400s a GET/HEAD/PUT/DELETE of them. A `//` object was therefore visible-but-unretrievable. Skip these keys (and degenerate common prefixes) from listings so LIST only advertises objects that are actually addressable, logging the raw key at `warn` so operators can find and remediate the stray upload. - api/list.rs: add `has_degenerate_segment` (empty / `.` / `..` segment) and filter it out of `collect_list_entries` for both objects and common prefixes. Common prefixes strip exactly one trailing delimiter first so `raw//` is caught while a normal `photos/` is not. - Tests: `unaddressable_keys_and_prefixes_skipped_from_listing` (unit) and the proxy end-to-end test now asserts the `//` key is skipped, not surfaced. Depends on #116 (this branch stacks on it — the lenient parser is what makes per-key skipping possible; object_store fails the whole page). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @alukach's task in 3m 2s —— View job ✅ No blocking issues — safe to merge.
The One non-blocking correctness gap worth a follow-up:
Simplify (ponytail)
💰 Estimated review cost: $0.68 · 3m01s · 18 turns |
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.
What I'm changing
Stacks on #117 (base branch is
worktree-fix-116-empty-path-segment, notmain).#117 stopped a single
//-segment key from 503-ing an entire prefix, but as a side effect it surfaced those keys in the listing even though they can't be fetched:object_store::path::Pathrejects a///./..key andvalidate_keyreturns 400 on any GET/HEAD/PUT/DELETE of one. That left a//object visible-but-unretrievable — a client sees it in the listing and then gets a 400 trying to fetch it.This PR resolves that inconsistency the simple way: skip unaddressable keys from listings so LIST only advertises objects that are actually retrievable, logging the raw key at
warnso operators can find and remediate the stray upload (as the issue suggested).A diagnostic against the real bucket (
obstore, the Python binding of the same Rustobject_storecrate) confirmed these keys fail client-side at path-parse for HEAD, GET, and LIST — they are unreachable through object_store by any route:How I did it
api/list.rs—has_degenerate_segment(empty /./..path segment) filterscollect_list_entriesfor both objects and common prefixes. Common prefixes strip exactly one trailing delimiter first, soraw//is caught while a genuinephotos/is not (trim_end_matcheswould wrongly cleanraw//toraw).unaddressable_keys_and_prefixes_skipped_from_listing(unit) covers//,.., and a degenerate common prefix; the proxy end-to-end test now asserts the//key is skipped rather than surfaced.Test plan
cargo test -p multistore --lib— 131 passcargo clippy -p multistore --all-targets— clean (no new warnings)cargo check -p multistore-cf-workers --target wasm32-unknown-unknown— compilesobstorediagnostic against the realncar-cesm2-arisebucket confirms the//key is unreachable via object_store🤖 Generated with Claude Code