Skip to content

fix(client): call versioned /v1/shards endpoint for shard uploads#879

Open
assafvayner wants to merge 1 commit into
mainfrom
fix/v1-shards-api-path
Open

fix(client): call versioned /v1/shards endpoint for shard uploads#879
assafvayner wants to merge 1 commit into
mainfrom
fix/v1-shards-api-path

Conversation

@assafvayner

@assafvayner assafvayner commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

The shard-upload client was still calling the old unversioned /shards path while every other CAS endpoint (chunks, reconstructions, xorbs, file-chunk-hashes) already uses a version prefix. This switches upload_shard to the canonical /v1/shards and registers that route on the simulation mock server.


Note

Low Risk
Small URL change only; risk is limited to environments that still expose only unversioned /shards without /v1/shards.

Overview
Shard uploads from RemoteClient::upload_shard now POST to /v1/shards instead of the legacy unversioned /shards, matching other versioned CAS routes (/v1/chunks, /v1/xorbs, etc.).

The simulation local server registers POST /v1/shards under the /v1 router and drops the root-level /shards alias so local/integration tests hit the same path the client uses.

Reviewed by Cursor Bugbot for commit 9a4ba3a. Bugbot is set up for automated code reviews on this repo. Configure here.

@assafvayner assafvayner requested a review from seanses June 26, 2026 18:49
@assafvayner assafvayner force-pushed the fix/v1-shards-api-path branch from 67ed9f3 to 33bae8d Compare June 26, 2026 20:34
@assafvayner assafvayner requested review from XciD and rajatarya June 26, 2026 20:35
upload_shard was the only CAS call still hitting the unversioned `/shards`
alias; every other endpoint (chunks, reconstructions, xorbs,
file-chunk-hashes) already carries a version prefix. The CAS server serves
root `/shards` only as a backwards-compat alias that it intends to remove
once clients stop using it, so switch to the canonical `/v1/shards`.

This restores the shard portion of #568, which was inadvertently reverted by
the long-lived branch merged in #410.

Also register `/v1/shards` on the simulation mock server so the shard-upload
tests exercise the versioned path.
@assafvayner assafvayner force-pushed the fix/v1-shards-api-path branch from 33bae8d to 9a4ba3a Compare June 26, 2026 20:39
@@ -193,7 +194,6 @@ impl LocalServer {
)
// Routes used by RemoteClient without /v1/ prefix
.route("/reconstructions", get(handlers::batch_get_reconstruction))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Might as well remove this route

@@ -193,7 +194,6 @@ impl LocalServer {
)
// Routes used by RemoteClient without /v1/ prefix

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

and this comment

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.

3 participants