[PR #315] [MERGED] refactor: followups (reserved slugs, moderation batches, http api split) #326

Closed
opened 2026-02-15 17:16:54 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/clawhub/pull/315
Author: @steipete
Created: 2/14/2026
Status: Merged
Merged: 2/14/2026
Merged by: @steipete

Base: mainHead: refactor/followups-2


📝 Commits (1)

  • 61b41f9 refactor: split httpApiV1 + consolidate moderation batches

📊 Changes

14 files changed (+1672 additions, -1582 deletions)

View changed files

📝 convex/_generated/api.d.ts (+14 -0)
📝 convex/httpApiV1.ts (+23 -1435)
convex/httpApiV1/shared.ts (+283 -0)
convex/httpApiV1/skillsV1.ts (+513 -0)
convex/httpApiV1/soulsV1.ts (+355 -0)
convex/httpApiV1/starsV1.ts (+51 -0)
convex/httpApiV1/usersV1.ts (+244 -0)
convex/httpApiV1/whoamiV1.ts (+26 -0)
convex/lib/batching.ts (+15 -0)
📝 convex/lib/reservedSlugs.ts (+19 -22)
📝 convex/schema.ts (+1 -0)
📝 convex/skills.rateLimit.test.ts (+3 -1)
📝 convex/skills.ts (+122 -0)
📝 convex/users.ts (+3 -124)

📄 Description

Followups after #298/#313.

  • reservedSlugs: add index + query helpers (no take+sort)
  • moderation: move user-ban/unban skill+embedding batching into skills; add scheduler helper
  • httpApiV1: split handlers into modules; keep exports stable + __handlers for tests

Gate:

  • bunx convex codegen
  • bun run lint
  • bun run build
  • bun run test

Greptile Overview

Greptile Summary

Refactored moderation batch operations and HTTP API structure with improved query performance.

  • Moved user ban/unban skill batching from users.ts to skills.ts for better domain separation
  • Split monolithic httpApiV1.ts (~1400 lines) into domain-specific modules (skillsV1.ts, soulsV1.ts, usersV1.ts, etc.) under httpApiV1/ directory, maintaining stable exports via __handlers for tests
  • Added by_slug_active_deletedAt compound index to reservedSlugs table to eliminate need for in-memory filtering and sorting - queries now use index ordering directly
  • Introduced scheduleNextBatchIfNeeded helper in lib/batching.ts to consolidate batch continuation logic
  • Refactored reserved slug helpers to use new index and eliminate pickLatestActiveReservation helper function

Confidence Score: 4/5

  • This PR is safe to merge with one logic concern to verify
  • Score reflects clean refactoring with improved modularity and query performance. The code structure improvements are well-executed, with proper domain separation and stable exports maintained. One potential logic change in moderation status handling needs verification (treating undefined as 'active' may affect legacy skills), but overall changes follow established patterns and maintain existing functionality.
  • Pay close attention to convex/skills.ts:2170 for the moderation status logic change

Last reviewed commit: 61b41f9


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/clawhub/pull/315 **Author:** [@steipete](https://github.com/steipete) **Created:** 2/14/2026 **Status:** ✅ Merged **Merged:** 2/14/2026 **Merged by:** [@steipete](https://github.com/steipete) **Base:** `main` ← **Head:** `refactor/followups-2` --- ### 📝 Commits (1) - [`61b41f9`](https://github.com/openclaw/clawhub/commit/61b41f9fda315704593280f32694538939acecde) refactor: split httpApiV1 + consolidate moderation batches ### 📊 Changes **14 files changed** (+1672 additions, -1582 deletions) <details> <summary>View changed files</summary> 📝 `convex/_generated/api.d.ts` (+14 -0) 📝 `convex/httpApiV1.ts` (+23 -1435) ➕ `convex/httpApiV1/shared.ts` (+283 -0) ➕ `convex/httpApiV1/skillsV1.ts` (+513 -0) ➕ `convex/httpApiV1/soulsV1.ts` (+355 -0) ➕ `convex/httpApiV1/starsV1.ts` (+51 -0) ➕ `convex/httpApiV1/usersV1.ts` (+244 -0) ➕ `convex/httpApiV1/whoamiV1.ts` (+26 -0) ➕ `convex/lib/batching.ts` (+15 -0) 📝 `convex/lib/reservedSlugs.ts` (+19 -22) 📝 `convex/schema.ts` (+1 -0) 📝 `convex/skills.rateLimit.test.ts` (+3 -1) 📝 `convex/skills.ts` (+122 -0) 📝 `convex/users.ts` (+3 -124) </details> ### 📄 Description Followups after #298/#313. - reservedSlugs: add index + query helpers (no take+sort) - moderation: move user-ban/unban skill+embedding batching into skills; add scheduler helper - httpApiV1: split handlers into modules; keep exports stable + __handlers for tests Gate: - bunx convex codegen - bun run lint - bun run build - bun run test <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> Refactored moderation batch operations and HTTP API structure with improved query performance. - Moved user ban/unban skill batching from `users.ts` to `skills.ts` for better domain separation - Split monolithic `httpApiV1.ts` (~1400 lines) into domain-specific modules (`skillsV1.ts`, `soulsV1.ts`, `usersV1.ts`, etc.) under `httpApiV1/` directory, maintaining stable exports via `__handlers` for tests - Added `by_slug_active_deletedAt` compound index to `reservedSlugs` table to eliminate need for in-memory filtering and sorting - queries now use index ordering directly - Introduced `scheduleNextBatchIfNeeded` helper in `lib/batching.ts` to consolidate batch continuation logic - Refactored reserved slug helpers to use new index and eliminate `pickLatestActiveReservation` helper function <h3>Confidence Score: 4/5</h3> - This PR is safe to merge with one logic concern to verify - Score reflects clean refactoring with improved modularity and query performance. The code structure improvements are well-executed, with proper domain separation and stable exports maintained. One potential logic change in moderation status handling needs verification (treating `undefined` as `'active'` may affect legacy skills), but overall changes follow established patterns and maintain existing functionality. - Pay close attention to `convex/skills.ts:2170` for the moderation status logic change <sub>Last reviewed commit: 61b41f9</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:16:54 -05:00
yindo closed this issue 2026-02-15 17:16:54 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#326