Coveo new GUID generation issue

Thursday last week, one of my team member ran in to an issue which was preventing XHR request to fire off to Coveo and get the results back. He struggled to overcome the issue almost whole day long and at that time as his lead it became my responsibility to help solve the issue. I was actually quite doubtful about it and unsure if I could help solve or not, but, as a lead, rule is you can not pass on fear to your team, you have to no matter you feel pass confidence that – ‘Yes, we will get over this’. Challenge Accepted!

Here is a sneak peek of the issue. So, in older versions of Coveo and in more fond memory on Legacy framework implementation, each interface element had a unique ID that you would need to pass from presentation details via properties on your rendering. If you do not do much about it, a unique identifier will be generated when you create a new content item that has the presentation of Coveo embedded. With hive, it is actually not so different, pretty similar, only the properties are on data sources. The issue on hand is that, on the interface view HTML, the @Model.ID was actually coming back as ‘$GenerateNewUniqueID’ instead of DOM Element ID noted on presentation. You can see this below on the screenshot.

Error on JS for generating unique ID.

So, as with any issue, it becomes very important to replicate the issue on local especially when you can not get your brain juices flowing on call on tough problems like this. See the steps I did to crack this thing

  1. Why would Coveo not replace this in first place? It should automatically happen. My team mate stumbled upon few Q&A and checked the pipeline related that does this behind the scenes to ensure that is in place and hooked properly.
  2. We checked the presentation again very carefully and datasources to ensure DOM ID is present and is unique
  3. Ensure this is copied over properly to Final Layout on Sitecore as well and indeed there is a correct data source being passed in presentation.
  4. Then we ran an ugly experiment to actually replace standard value as it seemed like Coveo for some reason was taking that. No luck, still same issue.
  5. Re-installed Coveo For Sitecore package relating to our Sitecore version and published everything. Still Nothing!
  6. This was working just fine on our UAT server, so, just to try our luck ported over all packages from UAT related to bare bone Coveo templates, layouts, etc., Nope! Did not work.
  7. Ran out of all options!

One little detail from my team mate sparked an experience from the past. He said when he installed a package that has just one item while he was experimenting did something and though the XHR request was still having lot of issues, he could now see the ID replaced now. That reminded me that in the past when we ran in to weird issues where presentation was not updated even if the presentation did look right on Coveo end, an IIS Reset had solved all problems. Went ahead and tried that and knocked out browser cache just in case and boom, everything started working.

I should have probably done IIS reset first before trying anything, but, with more knowledge you gather you would want to explore that rather than blind belief that a restart or reset would solve things. 🙂

This whole debugging experience got me thinking if I was not a Software Engineer, I would have made one awesome FBI Agent for some reason. It almost felt like I was connecting from past and paying attention of little detail on hand to solve the issue. Quite a few memories of great crime investigation series flashed in my brain. lol