# Repeated closed/duplicate annotations in question title

Best demonstrated with a screenshot:

Pretty sure there were less of them earlier. The question itself has just the single annotation.

-
That should have been [triplicate]. – Lance Roberts Jan 24 '13 at 0:50
LEFT OUTER JOIN gone bad, maybe? – bfavaretto Jan 24 '13 at 1:14
developers developers – Robert Harvey Jan 24 '13 at 1:14
I just saw one with closed repeated 10 times – bluefeet Jan 24 '13 at 1:38
Too bad a question, one close is not enough.. – Krishnabhadra Jan 24 '13 at 3:13
To be fair enough questions get closed on meta that you would have thought every possible scenario would have been thoroughly tested... – ben is uǝq backwards Jan 24 '13 at 6:25

This was related to a recent change I made to question titles...

... and the problem was caching*, always caching!

On the home page, we cache a list of recent question objects in ASP.NET's HttpRuntime.Cache, which subsequent requests will use to render your interesting questions.

These question objects have a NiceTitle property that will append those [closed], [duplicate], [migrated] status suffixes, and the code went something like this:

var suffix = GetQuestionStateSuffix();
if (suffix.HasValue())
Title += " " + suffix;
return Title;


This worked fine in testing; the homepage looked as beautiful as ever. It looked beautiful because none of the normal homepage code used this NiceTitle. **

Mobile, on the other hand, does use it. And this is where the intermittent bug came in. Those cached objects kept getting their Title happily overwritten each time a mobile user rendered a closed question's summary.

The fix is in and deployed - totally my bad.

* and a misguided assignment statement :)

Brace-less if block? shudders – NullUserException อ_อ Jan 24 '13 at 6:30