Skip to content

fix(storage): drop cross-bucket options from move#99

Merged
designcode merged 1 commit into
mainfrom
fix/error-on-cross-bucket-move
May 11, 2026
Merged

fix(storage): drop cross-bucket options from move#99
designcode merged 1 commit into
mainfrom
fix/error-on-cross-bucket-move

Conversation

@designcode
Copy link
Copy Markdown
Collaborator

@designcode designcode commented May 11, 2026

Summary

  • The server does not support cross-bucket move, so MoveOptions no longer accepts srcBucket / destBucket. Cross-bucket flows should use copy followed by remove.
  • JSDoc on move now states the constraint and points at the copy + remove workaround.
  • Changeset: patch bump for @tigrisdata/storage.

Test plan

  • pnpm --filter @tigrisdata/storage exec tsc --noEmit — clean
  • pnpm test — copy/move integration tests pass
  • biome check — clean (pre-commit hook)

🤖 Generated with Claude Code


Note

Medium Risk
This is a user-facing API change: move no longer accepts srcBucket/destBucket, which will break callers relying on cross-bucket moves. Runtime behavior should be safer (aligned with server constraints), but downstream TypeScript compile errors are expected until updated.

Overview
move is now explicitly limited to same-bucket renames: MoveOptions no longer inherits CopyOptions and only accepts config, removing srcBucket/destBucket support.

The implementation forwards only config into copyOrMove, and a changeset documents the breaking behavior change and recommends copy + remove for cross-bucket moves.

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

The server does not support cross-bucket move, so `MoveOptions` no longer
accepts `srcBucket` / `destBucket`. Cross-bucket flows should use `copy`
followed by `remove`.

Assisted-by: Claude Opus 4.7 via Claude Code
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 11, 2026

Greptile Summary

This PR removes the non-functional srcBucket and destBucket fields from MoveOptions, re-defines the type to only accept config, and updates the move call-site to forward only the config to copyOrMove. A JSDoc comment is added to document the same-bucket constraint and point users to the copy + remove workaround.

  • move.ts: MoveOptions is now a standalone type with only config; the move wrapper explicitly passes { config: options?.config } to copyOrMove, preventing any cross-bucket path from being reached.
  • Changeset: Filed as patch; technically a TypeScript breaking change (removed exported fields), so the semver level is worth confirming with the team before publishing.

Confidence Score: 4/5

The logic change is correct and minimal — cross-bucket fields are cleanly stripped before reaching copyOrMove. The only open question is whether the changeset bump level aligns with the team's versioning policy.

The code change itself is straightforward and correct: MoveOptions is narrowed to config-only and the call-site forwards only that field. The one flag is that removing fields from a publicly exported TypeScript type is a breaking change for consumers, and the changeset records it as a patch rather than a minor or major bump.

.changeset/move-same-bucket-only.md — confirm the semver bump level is appropriate for the removed exported fields.

Important Files Changed

Filename Overview
packages/storage/src/lib/object/move.ts Removes srcBucket/destBucket from MoveOptions, defines the type explicitly with only config, and updates the move wrapper to pass only the config field to copyOrMove. JSDoc added.
.changeset/move-same-bucket-only.md Changeset filed as patch for removing previously-unsupported fields from a public type; debatable under strict semver but pragmatically reasonable since the options never worked.

Reviews (1): Last reviewed commit: "fix(storage): drop cross-bucket options ..." | Re-trigger Greptile

Comment thread .changeset/move-same-bucket-only.md
@designcode designcode merged commit aa03ea5 into main May 11, 2026
2 of 3 checks passed
@designcode designcode deleted the fix/error-on-cross-bucket-move branch May 11, 2026 08:44
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.

2 participants