mirror of https://github.com/pixelfed/pixelfed
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
The GroupPost branch of NewCommentPipeline invalidated the cache using the comment id instead of the parent post id, so the cached post payload kept its stale reply_count. Invalidate the parent post id in both GroupPostService and GroupFeedService, and dispatch NewCommentPipeline from storeCommentPhoto so photo comments recompute the parent count too. Verification (worktree, sqlite :memory:, array cache, Redis::spy): pint --test on the three touched files: PASS (3 files, no style issues). Regression test tests/Feature/Groups/GroupPostReplyCountCacheTest.php RED (del() calls using the comment id, pre-fix): 2 failed, 1 passed (4 assertions) - top-level comment: Failed asserting that 0 is identical to 1 (line 69) - photo comment: Failed asserting that 0 is identical to 1 (line 113) - reply-to-comment control passed (branch already correct) GREEN (del() calls using $parent->id, with fix): 3 passed (4 assertions) The read-through assertion uses GroupPostService::get (not getCommentCount), proving the post cache key was invalidated and the payload rebuilt. |
1 week ago | |
|---|---|---|
| .. | ||
| GroupPostReplyCountCacheTest.php | ||