Home
Forums
New posts
Search forums
What's new
New posts
New media
New media comments
New resources
New profile posts
Latest activity
Media
New media
New comments
Search media
Resources
Latest reviews
Search resources
Members
Current visitors
New profile posts
Search profile posts
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
XenForo bug reports
Resolved bug reports
XF\Reaction\AbstractHandler::updateContentReactions no check for deleted reactions
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Xon" data-source="post: 1530621" data-attributes="member: 71874"><p>Every other location which touches [ICODE]container('reactions')[/ICODE] guards against the reaction id being tested against actually exists in the cache. This appears to be the only place which doesn't.</p><p></p><p>This can result in a race condition between a post reaction cache being rebuilt and the reactions container cache being rebuilt.</p><p>[CODE="php"]if ($scoreField)</p><p>{</p><p> $reactionsCache = \XF::app()->container('reactions');</p><p> $score = 0;</p><p> foreach ($counts AS $reactionId => $count)</p><p> {</p><p> $reaction = $reactionsCache[$reactionId];</p><p> $score += $count * $reaction['reaction_score'];</p><p> }[/CODE]</p><p></p><p>This can occur as the content reaction cache is rebuilt when other reactions are used, as it does an raw SQL check against [ICODE]xf_reaction.active[/ICODE] column. While the reactions container cache rebuild is punted to after the reaction update transaction.</p></blockquote><p></p>
[QUOTE="Xon, post: 1530621, member: 71874"] Every other location which touches [ICODE]container('reactions')[/ICODE] 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. [CODE="php"]if ($scoreField) { $reactionsCache = \XF::app()->container('reactions'); $score = 0; foreach ($counts AS $reactionId => $count) { $reaction = $reactionsCache[$reactionId]; $score += $count * $reaction['reaction_score']; }[/CODE] This can occur as the content reaction cache is rebuilt when other reactions are used, as it does an raw SQL check against [ICODE]xf_reaction.active[/ICODE] column. While the reactions container cache rebuild is punted to after the reaction update transaction. [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
XenForo bug reports
Resolved bug reports
XF\Reaction\AbstractHandler::updateContentReactions no check for deleted reactions
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top