fix(gcs): preserve encoded names and preconditions - #97
Open
aniketshukla1 wants to merge 3 commits into
Open
Conversation
|
| Filename | Overview |
|---|---|
| src/main/java/io/floci/gcp/services/gcs/GcsService.java | Shared withObjectLock now wraps put/patch/delete (and version delete); locks are released when holders hit zero; generation IDs use an AtomicLong. |
| src/main/java/io/floci/gcp/services/gcs/GcsObjectController.java | Patch and delete endpoints pass ObjectPreconditions into the service instead of checking outside the mutation. |
| src/main/java/io/floci/gcp/services/gcs/GcsUploadController.java | Media/multipart uploads pass preconditions into putObject; resumable start still checks at session start only. |
| src/test/java/io/floci/gcp/services/gcs/GcsServiceTest.java | Concurrent put/patch/delete precondition races and lock-churn cleanup coverage. |
| src/test/java/io/floci/gcp/services/gcs/GcsObjectControllerTest.java | HTTP regression that literal encoded object names round-trip on JSON and download paths. |
Reviews (4): Last reviewed commit: "fix(gcs): resolve main branch conflicts" | Re-trigger Greptile
aniketshukla1
force-pushed
the
fix/gcs-encoded-names-preconditions
branch
from
July 28, 2026 14:36
56b8c49 to
ae4ebc8
Compare
…dispatch GcsBatchController.rewriteToLocalhost fed getRawPath() into the multi-argument URI constructor, which treats its path argument as decoded and re-encodes the '%' — turning an already-encoded %2F into %252F. Batch sub-request URLs are absolute, so object names with reserved characters (e.g. the slash in "batch/object1.txt") arrived double-encoded and 404'd once the redundant second decode was removed from the object controller. Build the rewritten URI from the raw path via URI.create (as the method's own fallback already did), preserving percent-encoded segments. Fixes GcsBatchTest.
Author
|
@hectorvent please review again, fixed the failing issue. |
Contributor
|
Thanks @aniketshukla1, |
Author
|
@hectorvent done. Please check. Thanks. |
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.
Summary
Related issue: no dedicated open issue; this fixes a GCS compatibility regression identified during review.
Type of change
fix:)feat:)feat!:orfix!:)GCP Compatibility
JAX-RS path parameters are already decoded once. Decoding them again turns a literal encoded sequence such as
%2Finto a path separator. This change preserves the object name consistently across JSON metadata, JSON download, and XML download endpoints. It also makes object preconditions atomic with the mutation they guard.Checklist
./mvnw testpasses locally on JDK 25