Repository navigation
Conversation
…ss-project duplication Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: f8c71cf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ E2E Tests🟢 46 passed • view full report • view run Studio: https://plugins-e2e-test-studio-afn5wluki.sanity.dev Datasets: |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bdd21bd. Configure here.
… to destination Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Description
Duplicating to a Workspace in another Project fails with
401 Unauthorized - Session does not match project hostunder the defaultduallogin method.Since sanity-io/sanity#12933 (v5.30.0), dual mode stores a project-scoped token after login and prefers it over the cookie. The plugin built its destination client with
originClient.withConfig({projectId}), which carries the origin Project's token to the destination Project's host. Before that Studio change, dual-mode users usually stayed on cookie auth, which works across Projects, so the bug was hidden.This PR adds a
getDestinationClienthelper:auth.state.What to review
WorkspaceSummary.authOK for a plugin to rely on? It's a typed public field on the summary returned byuseWorkspaces().auth.stateemission. In 6.x the first emission is a real probe result, not a placeholder.Testing
getDestinationClient: same Project, other Project (uses its own client and unsubscribes), not logged in.loginMethod: 'dual'. It failed before this change with the error above, and succeeds after it in both directions.Notes for release
Fixes duplicating to a Workspace in another Project failing with "Session does not match project host".
🤖 Generated with Claude Code
Note
Medium Risk
Changes how API credentials are chosen for cross-project writes and reads; wrong client selection could still cause auth failures or writes to the wrong dataset, though behavior is scoped to the duplicator plugin with unit tests.
Overview
Fixes cross-project duplication failing with "Session does not match project host" when Studio uses project-scoped tokens (e.g.
duallogin). The plugin no longer builds the destination API client by only re-pointing the origin client’sprojectId/dataset, which carried the origin project’s credentials to another project’s host.A new
getDestinationClienthelper keeps same-project behavior (originClient.withConfigto the target dataset) but, for another project, resolves the client from the destination workspace’sauthstore and returnsnullif the user isn’t logged in there.Duplicatoruses this for destination status checks and forhandleDuplicate, and surfaces a clear critical message instead of a 401 when the destination workspace isn’t authenticated. Changing the destination clears stale messages. Vitest coverage covers same-project, cross-project, and not-logged-in cases.Reviewed by Cursor Bugbot for commit f8c71cf. Bugbot is set up for automated code reviews on this repo. Configure here.