Stuck in "Resolving structure" loop when restoring document to past state

13 replies
Last updated: Apr 29, 2021
Hey there. I have an issue with restoring my data. I want to restore a document that to a state 6 days ago, so further down the line. When I hit restore, I’m trapped in the
Resolving structure
loop and get following error in the network tab:
AI Update

I understand you're stuck in a "Resolving structure" loop when trying to restore a document to its state from 6 days ago. This is frustrating, and while this specific error pattern isn't documented in the official Sanity resources I've checked, I can help you troubleshoot it.

First, verify your history retention:

According to the Document History documentation, history retention depends on your plan:

  • Free Plan: 3 days
  • Growth Plan: 90 days
  • Enterprise Plan: 365 days

If you're on the Free plan, 6-day-old revisions won't be available. However, since you're seeing the restore interface, this is likely not your issue.

Troubleshooting steps to try:

  1. Examine the network error details - You mentioned seeing an error in the network tab. Look for:

    • The specific HTTP status code (400, 403, 500, etc.)
    • The error message in the response body
    • Any timeout indicators
    • Also check your browser's Console tab for JavaScript errors

    These details will reveal whether this is a permissions issue, API timeout, data problem, or something else.

  2. Try the programmatic restoration workaround - You can bypass the Studio UI entirely by using the History API. Use the API to fetch the document's history, find the specific _rev value from 6 days ago, and restore it using the JavaScript client's createOrReplace() method with that revision's data.

  3. Test with default structure - If you have a custom Structure Builder configuration in your sanity.config.js or desk structure file, temporarily disable it to use the default Studio structure. If the restore works with the default structure, there may be an issue with your custom configuration that's interfering with history navigation.

  4. Update your Studio version - Ensure you're running a current version of Sanity Studio, as various document operation bugs have been fixed in recent releases.

  5. Try the Compare Versions feature - As an alternative approach, use the document comparison tool to view the version from 6 days ago, then manually copy the content you need.

Getting more specific help:

Since this appears to be an unusual error, I'd strongly recommend sharing the actual error message from your network tab (and browser console) in the Sanity Community Slack or opening a support ticket if you're on a paid plan. The specific error details will help identify whether this is a known bug or something specific to your setup.

If you can share the actual error message here or in the community, we can provide much more targeted guidance on what's causing the "Resolving structure" loop.

Show original thread
13 replies
user A
Do you have an idea perhaps? I have no possibilities to resore my data right now
Interesting. Could you try disabling React Dev Tools then trying again?
Same. Also non-developers have that issue
Which tier plan do you have,
user J
?
Hey
user M
. I'm running with the professional plan
Ok, so not the access to document history that’s the issue. Have you defined a custom desk structure?
I did actually
Alright! We’re getting closer. When I’ve seen this in the past it’s because a
documentId
is the same as the title of its parent
listItem
in a list. For ex:

      S.listItem()
        .title('Home')
        .child(
          S.document()
            .schemaType('home')
            .documentId('home') // this is same as parent title
        ),
    ])
If that’s your issue here, you can change the title of the parent to anything other than the documentId’s title and you should be fine.
That’s a great clue. I think I’m doing this actually. I’ll have a shot at this 🙂
Thanks a lot
Hope it works out!
Just came across this one too and fixed by renaming the parent title. Thanks
user M
🙂 Could be worth calling this out as a “gotcha” in the docs where singletons are documented
user A
: https://www.sanity.io/docs/structure-builder-typical-use-cases
unless this is actually a bug in the studio

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?