I created a small addon whose purpose is to alter the coloring on the quest rewards further based on armor proficiency and a custom stat filter. After writing it, I noticed that each time you get a new quest, the UI locks up for a fraction of a second and then all the icons and names of the rewards display. I assume this is because the items are not in my cache yet and it had to get them in order to scan the tooltips.
My confusion is how this exactly works. My first revision used a for loop over each of the items in the quest rewards window and scanned each one. I execute this loop in a post-hook for QuestInfo_ShowRewards. This worked, but as I said, it came with a small period of interface lockup. My second solution was to wrap the inside of the for loop with:
self:ScheduleTimer(function() -- ... end, 0)
using AceTimer-3.0 (commit here). To my surprise, this worked fine but left no noticeable interference with the interface. Sure, there was sometimes a slight delay in applying the extra markings, but everything was still usable. I simply don't understand why this difference changes anything. My thought was that AceTimer would just execute all the code on the next frame since the time was set to 0, so it would have the same effect as my original method. If anyone could clear this up for me, I would be grateful.
In addition, if anyone has any better ideas on how to implement this, I would love to hear it. I feel like throwing a timer in is ugly at best.