Skip to content

fix(accounts): preserve comment moderation author edits#63

Merged
tomcasaburi merged 1 commit into
masterfrom
fix/comment-moderation-author-edits
Jun 7, 2026
Merged

fix(accounts): preserve comment moderation author edits#63
tomcasaburi merged 1 commit into
masterfrom
fix/comment-moderation-author-edits

Conversation

@tomcasaburi

@tomcasaburi tomcasaburi commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Preserve commentModeration.author as a distinct account-edit summary key so author ban and unban moderation edits are not lost or confused with the comment author object.
  • Apply pending and succeeded author-ban moderation edits through useEditedComment, updating both commentModeration.author and author.community.banExpiresAt for immediate UI feedback.
  • Cover ban, stale canonical unban, explicit propagated unban, and stored-summary behavior with tests.

Verification

  • yarn build
  • yarn lint (existing warning backlog, exits 0)
  • yarn type-check
  • yarn test
  • yarn test src/hooks/accounts/accounts.test.ts src/stores/accounts/utils.test.ts src/stores/accounts/accounts-actions.test.ts
  • yarn test:coverage:hooks-stores runs all tests successfully; the verifier still exits nonzero on existing repo-wide hooks/store coverage baseline gaps unrelated to this change.

Note

Medium Risk
Touches moderation/ban state reconciliation in hooks and account edit summaries; wrong logic could show incorrect ban status or premature success, but scope is limited and well covered by new tests.

Overview
Fixes how author ban/unban comment-moderation edits are tracked and shown in the UI.

Account edit summaries now store author moderation under a dedicated key (commentModeration.author) instead of flattening it into a generic author field, and explicit unbans (author: undefined) are kept in summaries instead of being dropped. useEditedComment compares and applies those edits by syncing both commentModeration.author and author.community.banExpiresAt, including staying pending when refreshed comment data still shows a stale ban. Store normalization and tests were updated for ban, unban, and persisted-summary behavior.

Reviewed by Cursor Bugbot for commit b867b01. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@tomcasaburi, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 28 minutes and 53 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e3904804-7581-4f34-94d9-2e82e5d6506e

📥 Commits

Reviewing files that changed from the base of the PR and between 78d7027 and b867b01.

📒 Files selected for processing (6)
  • src/hooks/accounts/accounts.test.ts
  • src/hooks/accounts/accounts.ts
  • src/stores/accounts/accounts-actions.test.ts
  • src/stores/accounts/accounts-actions.ts
  • src/stores/accounts/utils.test.ts
  • src/stores/accounts/utils.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/comment-moderation-author-edits

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomcasaburi tomcasaburi merged commit 722b244 into master Jun 7, 2026
8 checks passed
@tomcasaburi tomcasaburi deleted the fix/comment-moderation-author-edits branch June 7, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant