Fix reply pagination after preloading - #221
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce33f16dd0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| this.page = 1; | ||
| } | ||
| const page = options?.page ?? 1; | ||
| const size = options?.size ?? this.configMapData?.basic.replySize ?? 10; |
There was a problem hiding this comment.
Clamp zero-sized legacy configurations before fetching
Existing installations can have replySize: 0 because the previous settings schema only required a value and imposed no minimum. Unlike the former || 10 fallback, ?? 10 preserves that zero, so this path sends size=0 to the reply endpoint; the same unnormalized value is also passed to getNextReplyRequest, breaking subsequent pagination. The new form constraint does not migrate saved settings, so normalize the configured page size to a positive fallback before using it.
Useful? React with 👍 / 👎.
What this PR does
withReplySizeas the initial reply preload size and clamp it to the configured reply page sizeReproduction
Before this change, the first click fetched page one again and displayed no new replies. After this change, the first click appends page two.
Testing
pnpm -C packages/comment-widget testpnpm build./gradlew checkFixes #122