Sanity Studio v6.4.0: Improved requests error handling and bug fixes

This release adds organization-scoped user attributes for Studio developers and fixes several issues with copying references, review change connectors, and Safari compatibility.

Improved request error handling

We’ve done a major overhaul of how the Studio handles request errors and introduced utilities so plugin authors can delegate error handling to the studio’s own error handling. The Studio now handles failed requests gracefully instead of leaving you stuck. A dropped connection, a server hiccup, or a rate limit shows a clear dialog with a "Try again" button rather than crashing the studio.

Plugin authors can now delegate request failures in their code to this same UI. See more details in the Plugins API Reference.

Add user attribute types to CurrentUser

Studio developers can now access organization-scoped user attributes on the current user:

import {useCurrentUser} from 'sanity'

const currentUser = useCurrentUser()
const department = currentUser?.attributes?.find((attr) => attr.key === 'department')

attributes is optional and only present when /users/me is called with a project context. Supported attribute types: string, string-array, integer, integer-array, number, number-array, and boolean.

🐛 Notable bugfixes and improvements

Fixes a Safari-only bug where a single changed document to appeared to have no documents at all.

Fixed an issue where the review changes lines (those connectors from the history/changes panel that connect to your content) could remain visible after closing the review changes panel, and where they would only appear after scrolling.