Duplicate UIDs Gotcha
I'm honestly not sure how I would have found this in the pre Claude/Codex era. The footer is missing on live, but shows up on Preview. A full site publish doesn't fix it. I pointed Codex at the issue, and some sharing of GraphQL results later, it finds I have the UID field in my header duplicated in my footer, probably caused by duplicating a partial design at some point in the past.
I update the footer UID to a new GUID, push, and the footer appears. This is one of those cases where Preview is a lot more forgiving the Edge.
Update: Maybe not
Well, in the Codex/Claude era, writing blog posts has a double function. Capture knowledge (food for the LLMs) and filter hallucinations. Most off all, force you to carefully read the LLM output to make sure you understand it, and to make sure it holds up.
A close read turned up the following:
- The footer worked in Preview, but not in Publish.
- I shared the output of the layout GraphQL query, which showed that the footer fields were not being passed.
- Codex noticed a duplicate UID, the same value used in a global header and global footer, probably a result of the header partial design being duplicated at one point. Codex confidentially asserted this was the cause. However, I've been unable to replicate this in other environments. The components were in separate placeholder regions, so there was no ambiguity or conflict in the returned JSON.
- Codex did note an additional possible cause: the footer component may not have been published. I ran an item query against the footer component, and Codex noted that, though it was published, the template names in the GraphQL query field did not match those used in the Data Source folder. The client had requested an item template be renamed, and this change had not been published.
- A full site publish did not fix the issue. Updating the UID, followed by publishing the component did resolve the issue.
- I confirmed other sites built with the duplicate UID did not have the issue.
The timing indicates the UID was the root cause, but I can think of no logical reason that would have that effect, and I cannot reproduce that. Having a GraphQL reference obsolete template names, however, is a logical explanation, and I suspect the fact that the full site publish after that change did not fix the footer issue was either Experience Edge or ISR latency. Experience Edge, with the original publishing model, needs to rebuild each page layout, and despite the fact that the SitecoreAI publish page indicated the publish operation was complete, perhaps there was an additional latency. Or Next.js SSG/ISR hadn't yet noted the change. I'm not 100% sure what the cause was, but I suspect the duplicate UIDs, though sloppy, were harmless.
I must say, having Codex walk through the diagnostic queries, and having those results to review on a Sunday while trying to piece together what happened, is an excellent way to get familiar with the details of how pages are stitched together. The case file is unresolved, but the experience was not regretted.