From ccc94802ecdec14187a81fee203bd0d55538de47 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 12 Feb 2022 20:58:35 -0700 Subject: [PATCH 1/3] Update CommentPipeline, improve parent reply_count calculation - mysql only for now --- app/Jobs/CommentPipeline/CommentPipeline.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Jobs/CommentPipeline/CommentPipeline.php b/app/Jobs/CommentPipeline/CommentPipeline.php index e0ae491da..3d09b3a97 100644 --- a/app/Jobs/CommentPipeline/CommentPipeline.php +++ b/app/Jobs/CommentPipeline/CommentPipeline.php @@ -59,10 +59,13 @@ class CommentPipeline implements ShouldQueue $target = $status->profile; $actor = $comment->profile; - DB::transaction(function() use($status) { - $status->reply_count = DB::table('statuses')->whereInReplyToId($status->id)->count(); - $status->save(); - }); + if(config('database.default') === 'mysql') { + DB::transaction(function() use($status) { + $count = DB::select( DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"), [ 'kid' => $status->id]); + $status->reply_count = count($count); + $status->save(); + }); + } if ($actor->id === $target->id || $status->comments_disabled == true) { return true; From f8a38c31db19971824fc347f0baa0a663671d05e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 12 Feb 2022 21:08:58 -0700 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b2d4a36b..4c9e2459d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ - Updated PostComponent.vue, filter out non-text comments. ([a7346f21](https://github.com/pixelfed/pixelfed/commit/a7346f21)) - Updated Profile.vue component, fix v-once bug. ([4d003d00](https://github.com/pixelfed/pixelfed/commit/4d003d00)) - Updated filesystems config, set S3 visibility to public by default. Fixes #2913. ([49a53c27](https://github.com/pixelfed/pixelfed/commit/49a53c27)) +- Updated CommentPipeline, improve parent reply_count calculation. ([ccc94802](https://github.com/pixelfed/pixelfed/commit/ccc94802)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.2 (2022-01-09)](https://github.com/pixelfed/pixelfed/compare/v0.11.1...v0.11.2) From bb92d8d8d37a405911dd588d70dc825da9575319 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 12 Feb 2022 21:09:19 -0700 Subject: [PATCH 3/3] Update compiled assets --- public/js/spa.js | Bin 1552921 -> 1566227 bytes public/mix-manifest.json | Bin 1983 -> 1983 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/public/js/spa.js b/public/js/spa.js index 87a550aeba663c158d6d005dc3ce5cc9e1e6b919..c2f0e726cc09d6a229c49ba776361e8e15061c9a 100644 GIT binary patch delta 6795 zcmb7J3wTsTmj0^K>Ad?sNrw%*qC$J9}V=lM>R?CNth`*&+W-6q&o|lF4lyLD#IQ~tz^1q z29&-&DI9gFQh!L6A}*ZwD`BKSeRq1U&=+-ui)>@g4blAeK6`;zO>bJ29SvHBAh&=Wde# zH`FsHjfGCssN)urrA<@l{CTOZWmbCv4~BCb7d?8_bg^D zu+qzHnYJ6?ZXdxZAM*wD=L(7NQ8P0aj%5n`9nZ&$aB~}z4ZarUZtY_N{Jn+ArFpH) zT#{HJg`}u-Wf=Tl8%22FVP>|r_?g7@Qoo``k-lLAGc#_Zvk0ylWmf^~-~?EH)I5{1 zc6Pg>sy`g*_p6%G&wOIeh0&wtSumrT&xUK?GzX#X_vT)*1ir22i{S5jxeoZL%)FB0 zEDd```&Fes;vUtRYtDO4V^l?NfdPie%#kAvN+gO?gc2HY=M*}%lO8Eo!cpAMZL?kU zC~HItN93qHB;hjjkv=Kfqo9+GMxu%;l`DO4#*&f=r|(1qwk%=1>F2j~USy2+$ncvb zOs$wJ^~q7YEi4UdE~UAc%?TwXOo@n+E5e?&oxM^ZY7d9={SJF6oRQg9IQRgbUY#pB z6$&>o*>Tps5y)9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