fix: extension-bridge poller + pending_queue_actions schema - #41
Conversation
Two bugs that silently broke all extension mod actions (escalate/remove/approve): 1. Poller subreddit mismatch in extension-bridge.ts: pollPendingActions queried subreddit_id ILIKE subredditName, but the enqueue handler stores the Reddit t5_ ID in subreddit_id and the display name in subreddit_name. The query never matched so extension escalations were never picked up by the Devvit cron. Fixed by OR-ing across all three patterns: subreddit_name by display name, subreddit_id by display name (old rows), and subreddit_id by t5_ ID (new rows). 2. Schema mismatch in pending_queue_actions: The table was created with id UUID which rejects the sha256 hex strings the enqueue handler inserts, returning 500 on every action. The columns subreddit_name and verdict_hash were also missing. Added migration 20260526000001 to fix id to TEXT and add the missing columns.
🤖 Qwen Code ReviewSummaryThis PR addresses issues in the Issues
Suggestions
Automated review by Qwen AI |
🤖 Qwen Code ReviewSummaryThis PR addresses issues in the Issues
Suggestions
Automated review by Qwen AI |
Summary
Poller subreddit mismatch (
extension-bridge.ts):pollPendingActionswas queryingsubreddit_id ILIKE subredditName, but the enqueue handler stores the Reddit t5_ ID insubreddit_idand the display name insubreddit_name. The query never matched, so all extension escalations/removals/approvals were silently dropped by the Devvit cron. Fixed by OR-ing across all three patterns.Schema mismatch (
pending_queue_actions): Table was created withid UUIDwhich rejects the sha256 hex strings the enqueue handler inserts — every action returned 500. Columnssubreddit_nameandverdict_hashwere also missing. Added migration20260526000001to fixidtoTEXTand add the missing columns.Impact
These two bugs together meant extension mod actions (escalate/remove/approve) were 100% broken on any fresh DB setup. CollabGuard UI actions were unaffected.
For Alan's DB
Run the migration manually in the Supabase SQL editor:
Test plan
extension-escalatedtag