šŸ‘‹ Next.js Conf 2024: Come build, party, run, and connect with us! See all events

Discussion about reloading issue when clicking on mixed reference links in Sanity Studio

13 replies
Last updated: Apr 27, 2021
Here's something I just noticed (still on v.2.8.1): when clicking on šŸ”— from an array field consisting of multiple (mixed) reference types, the whole studio app is being reloaded completely (Connecting to Sanity ...) whereas clicking on such a link from non-mixed references the app goes there gracefully as expected. The link icon is shown differently too: it's smaller for the directly linked references.
Apr 27, 2021, 12:49 PM
It appears that the untyped links perform a lookup of the type (mapping the _id to the correct _type), then perform a redirect to the edit page. Because it fully reloads the app, it feels a bit abrupt.
Apr 27, 2021, 12:51 PM
There was a regression where it was temporarily possible to reference draft documents, which would give these link issues. Could you try upgrading to the latest version of the studio and check if any refs to drafts exist? If so, it'd be good to correct them.
Apr 27, 2021, 1:20 PM
I don't think this is it, I am not referencing any drafts.
Apr 27, 2021, 1:53 PM
Could you share how you've implemented the mixed reference field? Also, is it using any custom components?
Apr 27, 2021, 2:05 PM
The link href is:
/intent/edit/id=89f42315-a5f8-4e58-83cc-c9f24c0386d7/
- compared to
/intent/edit/id=7c191231-3dae-4c88-8126-24f696f85437;type=propertyType/
for non-mixed (and honestly, non-array type). As you can see, the type is already set here.
Apr 27, 2021, 2:10 PM
That's correct - intent links need a type indeed, so that would explain the reloading at least šŸ™‚ I've seen the same behaviour on a project that was on a lower version, where it disappeared after an upgrade. Did you try upgrading to
v2.9.1
to see if it resolves the issue?
Apr 27, 2021, 2:13 PM
That's correct - intent links need a type indeed, so that would explain the reloading at least šŸ™‚ I've seen the same behaviour on a project that was on a lower version, where it disappeared after an upgrade. Did you try upgrading to
v2.9.1
to see if it resolves the issue?
Apr 27, 2021, 2:13 PM
I will try to upgrade now
Apr 27, 2021, 2:13 PM
user M
that worked! I should have upgraded sooner, but I thought to hold off seeing some other regressions popping up here.
Apr 27, 2021, 2:17 PM
Even the šŸ”— icons are nice and consistent now! Thanks!
Apr 27, 2021, 2:18 PM
Apologies for the regression - we had an unforeseen issue with the search update that we had to revert as a result. We're working on a fix, but the latest version is stable as far as I've seen šŸ™‚
Indeed they are! The components team migrated reference inputs to Sanity UI
āœØ
Apr 27, 2021, 2:19 PM
Apologies for the regression - we had an unforeseen issue with the search update that we had to revert as a result. We're working on a fix, but the latest version is stable as far as I've seen šŸ™‚
Indeed they are! The components team migrated reference inputs to Sanity UI
āœØ
Apr 27, 2021, 2:19 PM

Sanityā€“ build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?