Repository navigation
fix(services/gcs): encode object paths exactly once - #7947
Merged
Merged
Conversation
…ng-with-reqsign-rc
Xuanwo
marked this pull request as ready for review
July 27, 2026 01:45
PsiACE
approved these changes
Jul 27, 2026
SeverinAlexB
added a commit
to pubky/pubky-homeserver
that referenced
this pull request
Oct 16, 2026
opendal 0.58.1 fixes the GCS writer that percent-encoded object names twice (apache/opendal#7947), the cause of the objects that v0.13.0 to v0.16.1 misnamed. The repair of those objects stays: upstream does not move them. opendal 0.58 replaced the accessor and layer API, so the homeserver's layers are ported to the new `Service` trait: - Layers wrap a type-erased `Servicer`, and every call carries an `OperationContext`. The finalization and the staged publish reach the backend as an `Operator` built from both. - Writers and copiers are now created synchronously. The write path check and the collision preflight run before the first byte, the close, or the copy reaches the backend, see `preflight`. The generation condition on a publish or delete is now opendal's own `if_version_match`, which GCS sends as `ifGenerationMatch`. The HTTP client that added the condition behind opendal's back is removed: opendal 0.59 reports a refusal of a condition it did not set as `Unexpected`, not `ConditionNotMatch`, so stale publishes would no longer read as conflicts. Checked against a real bucket. GCS now refuses a conditional delete of a missing object. The name repair treats such a refusal as done when the object is gone, as when two homeservers repair at once. `dav-server-opendalfs` moves to 0.7.10, the release built on opendal 0.59.4. Requires Rust 1.91. Refs #703
SeverinAlexB
added a commit
to pubky/pubky-homeserver
that referenced
this pull request
Oct 16, 2026
opendal 0.58.1 fixes the GCS writer that percent-encoded object names twice (apache/opendal#7947), the cause of the objects that v0.13.0 to v0.16.1 misnamed. The repair of those objects stays: upstream does not move them. opendal 0.58 replaced the accessor and layer API, so the homeserver's layers are ported to the new `Service` trait: - Layers wrap a type-erased `Servicer`, and every call carries an `OperationContext`. The finalization and the staged publish reach the backend as an `Operator` built from both. - Writers and copiers are now created synchronously. The write path check and the collision preflight run before the first byte, the close, or the copy reaches the backend, see `preflight`. The generation condition on a publish or delete is now opendal's own `if_version_match`, which GCS sends as `ifGenerationMatch`. The HTTP client that added the condition behind opendal's back is removed: opendal 0.59 reports a refusal of a condition it did not set as `Unexpected`, not `ConditionNotMatch`, so stale publishes would no longer read as conflicts. Checked against a real bucket. GCS now refuses a conditional delete of a missing object. The name repair treats such a refusal as done when the object is gone, as when two homeservers repair at once. The name repair copies a misnamed object with a compose of one source instead of a copy. opendal's GCS service takes a source generation on a compose but not on a copy, and the repair must copy only the generation whose content it checked: a replaced source is gone and answers 404, which makes the repair look at the entry again. The object made is a composite one, which keeps the content type passed but has no MD5. `dav-server-opendalfs` moves to 0.7.10, the release built on opendal 0.59.4. Requires Rust 1.91. Refs #703
SeverinAlexB
added a commit
to pubky/pubky-homeserver
that referenced
this pull request
Oct 19, 2026
opendal 0.58.1 fixes the GCS writer that percent-encoded object names twice (apache/opendal#7947), the cause of the objects that v0.13.0 to v0.16.1 misnamed. The repair of those objects stays: upstream does not move them. opendal 0.58 replaced the accessor and layer API, so the homeserver's layers are ported to the new `Service` trait: - Layers wrap a type-erased `Servicer`, and every call carries an `OperationContext`. The finalization and the staged publish reach the backend as an `Operator` built from both. - Writers and copiers are now created synchronously. The write path check and the collision preflight run before the first byte, the close, or the copy reaches the backend, see `preflight`. The generation condition on a publish or delete is now opendal's own `if_version_match`, which GCS sends as `ifGenerationMatch`. The HTTP client that added the condition behind opendal's back is removed: opendal 0.59 reports a refusal of a condition it did not set as `Unexpected`, not `ConditionNotMatch`, so stale publishes would no longer read as conflicts. Checked against a real bucket. GCS now refuses a conditional delete of a missing object. The name repair treats such a refusal as done when the object is gone, as when two homeservers repair at once. The name repair copies a misnamed object with a compose of one source instead of a copy. opendal's GCS service takes a source generation on a compose but not on a copy, and the repair must copy only the generation whose content it checked: a replaced source is gone and answers 404, which makes the repair look at the entry again. The object made is a composite one, which keeps the content type passed but has no MD5. `dav-server-opendalfs` moves to 0.7.10, the release built on opendal 0.59.4. Requires Rust 1.91. Refs #703
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.
Which issue does this PR close?
Closes #7942.
This restores the fix for #7926 after #7927 was reverted by #7943. It depends on apache/reqsign#785, released in
reqsign v0.20.3.Rationale for this change
GCS request builders own percent-encoding, but the writer currently pre-encodes logical object paths before passing them to those builders. Nested object names are therefore encoded twice and cannot be read back through the same OpenDAL path.
#7927 removed the writer-side encoding, but the reqsign implementation used at that time decoded and rebuilt caller-owned query URIs during signing. That caused real GCS behavior tests to fail and required the revert. Reqsign v0.20.3 treats the input URI as wire-ready and preserves it during header signing, so OpenDAL can encode the GCS path exactly once without the signer changing the request.
An A/B reproducer using the same GCS upload URI fails with the pre-0.20.3 package set (
failed to apply signing request, URI replaced with/) and succeeds with the published v0.20.3 package set while preserving the complete URI.What changes are included in this PR?
This PR remains draft while CI reruns against the published crates. The previous head passed both real GCS behavior configurations.
Are there any user-facing changes?
Yes. GCS writes to nested or reserved-character object names use the same logical object name as read, stat, and multipart operations. There is no public API or call-site change.
Verification
cargo metadata --locked --format-version 1in the core and Ruby workspaces, plus independent resolution in the .NET and OCaml workspaces.cargo check --workspace --all-targets --all-features --locked.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings../scripts/workspace.py cargo fmt -- --check.taplo format --check.gcsandgcs_with_default_storage_class.AI Usage Statement
OpenAI Codex (GPT-5) was used to analyze the cross-repository signing contract, implement the change, and run validation. The resulting diff and test output were reviewed by the author.