Repository navigation
fix(dystopia): refresh author lists and feed comment counts after writes - #1550
Merged
Merged
Conversation
SWR's matcher mutate skips useSWRInfinite keys, so the profile posts/media and replies tabs kept stale pages until a reload after posting or commenting. Author list hooks now register their refresh in a post-module registry (same shape as the karte one) that the composer and comment hooks call after writing. Feed lists hold posts outside SWR, so a card's comment count stayed stale after commenting in the detail sheet. usePost now records the fetched count in a store that PostCardBinding prefers over its prop. Claude-Session: https://claude.ai/code/session_01DA9qTtJtm2tPquKk7hyPR5 Signed-off-by: panicboat <panicboat@gmail.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Kustomize DiffService: No changes |
panicboat
added this pull request to stack #1552
October 17, 2026 07:02
panicboat
marked this pull request as ready for review
October 17, 2026 11:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1507
Why
書き込み後にリロードしないと表示が更新されない箇所が残っていた。
$inf$key(useSWRInfinite)をスキップする(config-context-*.mjsの!/^\$(inf|sub)\$/.test(key))。そのため投稿作成時の述語 mutate が届かず、コメント追加・削除後はそもそも mutate されていなかった投稿詳細のコメント・返信の再取得は #1545 で
unstable_serializeによる key 指定に変わり、修正済み。What
modules/post/lib/revalidate.ts: karte のrevalidate.tsと同じ形の refresh 登録の仕組み。useAuthorPosts/useAuthorCommentsが登録し、投稿作成・コメント追加・コメント削除のあとにrevalidatePostLists()を呼ぶstores/postCommentCountStore.ts:usePostが取得したコメント数を記録し、PostCardBindingは store の値があればそれを優先する(いいね数のpostLikeStoreと同じ形)Verification
pnpm exec vitest run: 184 files / 778 tests passed(新規postListRefresh.test.tsx、PostCardBinding.commentsCount.test.tsx、PostComposerSheet.test.tsxへの追加を含む)pnpm exec tsc --noEmit: exit 0🤖 Generated with Claude Code
https://claude.ai/code/session_01DA9qTtJtm2tPquKk7hyPR5