fix(mod queue): stop resurfacing stale pending history#1130
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds two utility functions to filter and manage queued comment history visibility based on moderation terminal states, live feed presence, and board address matching, then integrates them into ModQueueView to replace prior manual filtering logic in snapshot collection and feedWithHistory construction. ChangesQueued Comment History Visibility Filtering
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
Summary
Root cause
The mod queue persisted every queued item in
mod-queue-storageand later merged that history back into the visible queue when the live feed no longer returned the item. On5chan.app, old pending snapshots from localStorage could therefore survive hard refreshes and reappear even after another moderator approved the posts.Verification
corepack yarn test src/lib/utils/__tests__/mod-queue-utils.test.tscorepack yarn lintcorepack yarn type-checkcorepack yarn testcorepack yarn doctorcorepack yarn knipcorepack yarn buildgit diff --checkNote
Medium Risk
Changes how the moderation queue persists and rehydrates items, which can affect what moderators see and act on, but is limited to client-side filtering/presentation logic.
Overview
Prevents the mod queue UI from re-adding stale pending items from persisted
queuedCommentHistoryonce they’ve disappeared from the live feed.This introduces
shouldKeepQueuedCommentHistory/getVisibleQueuedCommentHistoryto only persist and resurface terminal local moderation outcomes (approved/rejected/removed), and updatesModQueueViewto use these helpers when snapshotting feed items and merging history back into the visible feed. Adds unit tests covering the terminal-state rule and the stale-pending regression.Reviewed by Cursor Bugbot for commit 58b20e7. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit