Repository navigation
An object storage prefix is listed as written, so a folder named "Case #12" syncs its files - #1421
Open
rudycelekli wants to merge 2 commits into
Open
rudycelekli wants to merge 2 commits into
rudycelekli wants to merge 2 commits into
Conversation
WaylandYang
requested changes
Oct 25, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
The fix is right, and it fixes more than the title says: Path::from percent-encodes every non-ASCII byte, so a Chinese folder prefix lists nothing on dev either. Please add a case like 合同/2024 to the test and mention it in the description. Then it's ready.
…e #12" syncs its files Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
…rom also escaped non-ASCII prefixes Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
rudycelekli
force-pushed
the
object-storage-prefix-raw
branch
from
November 5, 2026 03:10
0dad50d to
8ef820f
Compare
Contributor
Author
|
Added a 合同/2024 case to a_prefix_with_symbols_lists_its_objects (it lists nothing with Path::from and passes with the fix), and rebased on dev. |
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.
Why
An S3, Azure Blob or GCS source can be limited to a prefix.
fetchturns that prefix into anobject_storepath withPath::from. That constructor percent-encodes every characterobject_storeconsiders unsafe in a path segment, including#,[,],%,~,{,},|,?and*.The bucket's keys are not encoded. A folder named
Case #12is listed asCase %2312/, which matches nothing. The sync then reports success with zero files, which is the hardest failure for a user to notice. Listed object locations are already read raw (Path::parseon each key), so only the prefix is affected.What changes
The prefix is read with
Path::parse, which keeps the characters as written. It still strips leading and trailing slashes. If parsing fails, for example on an empty segment likea//b, the code falls back toPath::from, so such prefixes behave exactly as before.How it was checked
A new test,
a_prefix_with_symbols_lists_its_objects, puts three objects into an in-memory store and syncs two prefixes:Case #12listss3://b/Case #12/brief.txt.Q1 [final]/listss3://b/Q1 [final]/plan.md.Results:
cargo test -p utopia-server --bins object_storage: 7 passed.Case #12withleft: [],right: ["s3://b/Case #12/brief.txt"].cargo fmt --all --checkandcargo clippy -p utopia-server --all-targets -- -D warningspass.Before review
git commit -s)cargo fmt --all --check,cargo clippyandcargo testpass for the touched crateThis also fixes non-ASCII prefixes.
Path::frompercent-encodes every non-ASCII byte, so on dev a Chinese folder prefix such as合同/2024lists no objects either. The test now covers that case.