Issue with publishing new content in Sanity Studio + NextJs project.
116 replies
Last updated: Sep 9, 2022
P
Hi Team,
we are facing an issue that is blocking the production of our corporate website
it's a project involving Sanity Studio + NextJs
it has always worked perfectly
but suddenly we are not able to publish new content (at least from last week)
no errors or warnings are returned by the Studio
Here are the steps to reproduce the issue:
1 - updated a field in a document and published the change
https://files.slack.com/files-pri/T9Y440GN8-F041N6HTDLM/new-content.png 2 - schema is correctly updated
https://files.slack.com/files-pri/T9Y440GN8-F041R5NSVJ6/schema.png 3 - query (in Vision panel) returns an old version of the document without latest changes,
please notice the outdated '_updatedAt' value
https://files.slack.com/files-pri/T9Y440GN8-F041R5Q64H0/query-01.png
https://files.slack.com/files-pri/T9Y440GN8-F041N6LCJ2Z/query-02.png On the NextJs side
4 - query result is the same as in Vision (outdated)
https://files.slack.com/files-pri/T9Y440GN8-F041R5RCZ34/no-preview-mode.png
5 - new content is correctly displayed in Preview Mode only
https://files.slack.com/files-pri/T9Y440GN8-F042ES92Q8G/preview-mode.png
Can you please help us to figure out what's going on and a possible fix?
We have a bunch of resources blocked on this (devs, qa, editors) since days
and it's starting to have a very bad impact on the economic metrics of our company
Thanks!
we are facing an issue that is blocking the production of our corporate website
it's a project involving Sanity Studio + NextJs
it has always worked perfectly
but suddenly we are not able to publish new content (at least from last week)
no errors or warnings are returned by the Studio
Here are the steps to reproduce the issue:
1 - updated a field in a document and published the change
https://files.slack.com/files-pri/T9Y440GN8-F041N6HTDLM/new-content.png 2 - schema is correctly updated
https://files.slack.com/files-pri/T9Y440GN8-F041R5NSVJ6/schema.png 3 - query (in Vision panel) returns an old version of the document without latest changes,
please notice the outdated '_updatedAt' value
https://files.slack.com/files-pri/T9Y440GN8-F041R5Q64H0/query-01.png
https://files.slack.com/files-pri/T9Y440GN8-F041N6LCJ2Z/query-02.png On the NextJs side
4 - query result is the same as in Vision (outdated)
https://files.slack.com/files-pri/T9Y440GN8-F041R5RCZ34/no-preview-mode.png
5 - new content is correctly displayed in Preview Mode only
https://files.slack.com/files-pri/T9Y440GN8-F042ES92Q8G/preview-mode.png
Can you please help us to figure out what's going on and a possible fix?
We have a bunch of resources blocked on this (devs, qa, editors) since days
and it's starting to have a very bad impact on the economic metrics of our company
Thanks!
Sep 9, 2022, 11:08 AM
K
Hello. Please kindly group your messages so we can use a single thread to discuss your situation.
Sep 9, 2022, 11:42 AM
K
Right now there are 8 different threads, which is pretty fragmented and confusing.
Sep 9, 2022, 11:42 AM
P
how can I group those?
Sep 9, 2022, 11:46 AM
K
Send a single message into the thread with all the information you have. :)
Sep 9, 2022, 11:50 AM
P
🙂
Sep 9, 2022, 11:51 AM
P
done
Sep 9, 2022, 11:52 AM
P
is it ok?
Sep 9, 2022, 11:52 AM
K
Amazing. ❤️
Sep 9, 2022, 11:52 AM
K
So much better, thank you!
Sep 9, 2022, 11:52 AM
K
What revalidation system do you have in place?
Sep 9, 2022, 1:05 PM
P
we use 'getServerSideProps'
Sep 9, 2022, 1:07 PM
P
no revalidation
Sep 9, 2022, 1:07 PM
K
I see. Do you set some caching headers perhaps?
Sep 9, 2022, 1:07 PM
P
nop
Sep 9, 2022, 1:08 PM
P
it has always worked fine before
Sep 9, 2022, 1:08 PM
P
suddenly this weird behavior
Sep 9, 2022, 1:08 PM
K
Do you use the Sanity CDN?
Sep 9, 2022, 1:08 PM
P
nop
Sep 9, 2022, 1:08 PM
P
could it be related to some quota limit?
Sep 9, 2022, 1:09 PM
P
attributes for example?
Sep 9, 2022, 1:09 PM
P
the documents are very complex in structure
Sep 9, 2022, 1:09 PM
K
Mmmh, maayyyyhaps? I'm not super sure I must say.
Sep 9, 2022, 1:09 PM
P
this is the dataset status
Sep 9, 2022, 1:10 PM
P
no limit warnings anyway ...
Sep 9, 2022, 1:11 PM
Do I understand it correctly: You are not able to see changes published in the studio when querying with Vision? Could you DM me your project ID?
Sep 9, 2022, 1:15 PM
P
8iokmtkl
Sep 9, 2022, 1:16 PM
P
correct
Sep 9, 2022, 1:16 PM
Could you double check if you’re editing the same dataset that your frontend is connected to? The examples in your screenshots seem to come from the
testdataset, but I see you have one called
productiontoo.
Sep 9, 2022, 1:20 PM
P
already checked
Sep 9, 2022, 1:22 PM
P
unfortunatelly it happens with both datasets
Sep 9, 2022, 1:22 PM
P
I suspect it could be related to some content limit
Sep 9, 2022, 1:23 PM
P
attributes maybe
Sep 9, 2022, 1:24 PM
P
because documents are very complex in structure
Sep 9, 2022, 1:24 PM
P
a lot of fields
Sep 9, 2022, 1:24 PM
P
but it's just a guess of course
Sep 9, 2022, 1:24 PM
P
no errors or warnings returned
Sep 9, 2022, 1:24 PM
You’re close, but haven’t hit them. Curious, do you get any error message in the console, or network requests that aren’t 200 in the network pane when publishing?
Sep 9, 2022, 1:26 PM
P
let me check
Sep 9, 2022, 1:27 PM
P
these are returned before publishing
Sep 9, 2022, 1:29 PM
P
but nothing after pushing
Sep 9, 2022, 1:30 PM
P
no 200 errors
Sep 9, 2022, 1:31 PM
P
only this is weird
Sep 9, 2022, 1:31 PM
Would it be OK if you invited me to your project for a bit? knut@sanity.io
Sep 9, 2022, 1:31 PM
P
sure
Sep 9, 2022, 1:32 PM
P
let me connect to a call
Sep 9, 2022, 1:32 PM
P
will be back to you asap
Sep 9, 2022, 1:32 PM
P
uhm I can invite you but the studio runs under a vpn
Sep 9, 2022, 1:35 PM
P
what if I share my screen
Sep 9, 2022, 1:35 PM
P
and you tell me what to do?
Sep 9, 2022, 1:36 PM
P
do you need a specific role?
Sep 9, 2022, 1:37 PM
P
sent invitation for a viewer
Sep 9, 2022, 1:37 PM
P
ok
Sep 9, 2022, 1:40 PM
P
done
Sep 9, 2022, 1:41 PM
Hm. I’m not able to reproduce it. I can write and update published documents on
testat least.
Sep 9, 2022, 1:52 PM
P
?
Sep 9, 2022, 1:54 PM
P
the schema is correctly published
Sep 9, 2022, 1:54 PM
P
but the query doesn't get the published content
Sep 9, 2022, 1:55 PM
P
all works fine in preview mode on the frontend
Sep 9, 2022, 1:55 PM
P
but not the query
Sep 9, 2022, 1:55 PM
P
what implementation part could determine the issue?
Sep 9, 2022, 1:56 PM
P
yes but it gets an outdated content
Sep 9, 2022, 1:57 PM
P
that is actually the issue 🙂
Sep 9, 2022, 1:57 PM
P
and one thing I don't get is why it stopped working suddenly
Sep 9, 2022, 1:57 PM
P
without breaking changes in the implementation logic
Sep 9, 2022, 1:58 PM
Hm. What would be an _id or title of a page that you expected to be updated, but isn’t?
Sep 9, 2022, 2:04 PM
P
homePage
Sep 9, 2022, 2:05 PM
P
_id
Sep 9, 2022, 2:06 PM
Aight - and I can only see one document in the production dataset that was last edited
"2022-09-08T10:25:41Z"– can you actually see unpublished edits in the studio that’s newer than this?
Sep 9, 2022, 2:10 PM
P
"seoTitle": "2222224544444444SEO & METADATA",
Sep 9, 2022, 2:12 PM
P
are you referring to the test dataset?
Sep 9, 2022, 2:12 PM
P
ah sorry
Sep 9, 2022, 2:13 PM
P
just a sec
Sep 9, 2022, 2:13 PM
P
so
Sep 9, 2022, 2:16 PM
P
in the schema :
Sep 9, 2022, 2:16 PM
P
seoTitle:3453535Canary: A complete home security system in a single device. – Canary
Sep 9, 2022, 2:16 PM
P
_updatedAt:2022-09-08T16:05:43Z
Sep 9, 2022, 2:17 PM
P
in the vision query and frontend:
Sep 9, 2022, 2:17 PM
P
"_updatedAt":"2022-09-08T10:25:41Z"
Sep 9, 2022, 2:18 PM
P
old seoTitle
Sep 9, 2022, 2:18 PM
P
give me a hope please!!!! 🙂
Sep 9, 2022, 2:19 PM
P
?
Sep 9, 2022, 2:20 PM
I need to check with the Content Lake team. It seems like something is out of sync here.
Sep 9, 2022, 2:21 PM
P
so we wait for your feedback?
Sep 9, 2022, 2:21 PM
P
thanks!
Sep 9, 2022, 2:31 PM
P
cool!!!!
Sep 9, 2022, 3:02 PM
Side note: It’s probably not super productive feedback, but I’d look into generalizing the content models a bit more. It seems like you use
_typefor very specific pages and that you have a lot of attributes for presentational concerns (colors etc). These are patterns that drive a lot of attributes, but often can be moved to frontend design systems mapped to simpler values etc. If that makes any sense.
Sep 9, 2022, 3:03 PM
P
yeah I share your concern ....
Sep 9, 2022, 3:05 PM
P
ure
Sep 9, 2022, 3:15 PM
P
yep it's working!
Sep 9, 2022, 3:16 PM
P
what was the issue about???
Sep 9, 2022, 3:17 PM
P
it seems not working for test dataset
Sep 9, 2022, 3:21 PM
P
production dataset seems fine
Sep 9, 2022, 3:21 PM
P
it's working!
Sep 9, 2022, 3:28 PM
Awesome. We’re looking into the core issue, but there was a sync issue. We triggered a manual sync to fix it. We’ll look into why it didn’t happen automatically.
Sep 9, 2022, 3:34 PM
P
so there's nothing we can do to avoid this kind of issues in the future right?
Sep 9, 2022, 3:35 PM
P
so ticket closed right?
Sep 9, 2022, 3:38 PM
P
or are you still checking?
Sep 9, 2022, 3:38 PM
P
ah noticed the checkmark now
Sep 9, 2022, 3:40 PM
P
thank you very much!
Sep 9, 2022, 3:40 PM
P
have a great weekend!
Sep 9, 2022, 3:40 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.