Thursday, March 16, 2017

Sitecore contacts error with FlushContactToXdb method

Working with contacts and custom data, during the identification process in some cases the FlushContactToXdb method on ContactManager was giving the following error:
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
As with many of the community I was using the ExtendedContactRepository class from Brian Pedersen. It turns out that there was a possibility for infinite loop with the GetOrCreateContact method, which is detailed here. Effectively the repository was attempting to save a contact as new when it already exists with the given identifier.

An update to the repository appears to solve the issue in my case.

No comments:

Post a Comment