- Affected version
- 2.2.6
Every other location which touches
This can result in a race condition between a post reaction cache being rebuilt and the reactions container cache being rebuilt.
This can occur as the content reaction cache is rebuilt when other reactions are used, as it does an raw SQL check against
container('reactions')
guards against the reaction id being tested against actually exists in the cache. This appears to be the only place which doesn't.This can result in a race condition between a post reaction cache being rebuilt and the reactions container cache being rebuilt.
PHP:
if ($scoreField)
{
$reactionsCache = \XF::app()->container('reactions');
$score = 0;
foreach ($counts AS $reactionId => $count)
{
$reaction = $reactionsCache[$reactionId];
$score += $count * $reaction['reaction_score'];
}
This can occur as the content reaction cache is rebuilt when other reactions are used, as it does an raw SQL check against
xf_reaction.active
column. While the reactions container cache rebuild is punted to after the reaction update transaction.