Occasional Bug with Event Caching

During a QA review of a redesign today a ColdBox bug was frequently, yet randomly occurring when ColdBox tries to set the rendered event output into the cache. The error occurs at “/system/Coldbox.cfc line 278” (screenshot attached – I could not get the full stack as someone else was running through the site in a shared screen session).

It appears that a key(s) within the struct “eventCacheEntry” may not always exist. I’ve wrapped this statement within a IF statement (see below) but I don’t think this is the best fix.

<cfif isStruct(eventCacheEntry)
&& structKeyExists(eventCacheEntry,‘timeout’)
&& structKeyExists(eventCacheEntry,‘lastAccessTimeout’)>

<cfset templateCache.set(eventCacheEntry.cacheKey,
renderedContent,
eventCacheEntry.timeout,
eventCacheEntry.lastAccessTimeout)>

Has anyone else seen this? I’m running bleeding edge ColdBox.

Thanks,

Aaron

Ok, I reworked it a little bit and since I can’t contain myself I added a new feature: fixed #1314 event caching now respects content types and supports renderdata as it was rendered, great for RESTful services

So now, event caching will respect renderData() content type, status codes and the right encoding as it was rendered initially. Hope you enjoy it.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Thanks, I’ll pull and give it a shot.

I’d like to create a pull request to allow developers to have more control over the key generated for cached events. Ideally, I’d like to make it so only valid/accepted values are considered. Perhaps when you have time we can chat via Skype to get your thoughts before I start coding?

Thanks,

Aaron

sure, via an annotation?

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Annotations would be perfect. Unless you can knock it out quickly, I don’t mind writing it. But, would appreciate a quick discussion regarding implementation before I begin.

Thanks,

A

Yes let’s do that