[PR #274] [CLOSED] fix: preserve moderation status when updating existing skills #307

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

📋 Pull Request Information

Original PR: https://github.com/openclaw/clawhub/pull/274
Author: @superlowburn
Created: 2/13/2026
Status: Closed

Base: mainHead: fix/skill-disappears-on-update


📝 Commits (1)

  • 78adda1 fix: preserve moderation status when updating existing skills (#134)

📊 Changes

1 file changed (+11 additions, -3 deletions)

View changed files

📝 convex/skills.ts (+11 -3)

📄 Description

Fixes #134

Problem

When users published updates to existing skills, the skills would immediately disappear from search and listings, even if they had downloads and stars. This affected multiple users (#134, #131).

The issue was that insertVersion was setting moderationStatus: 'hidden' unconditionally for ALL skill versions, including updates to existing active skills.

Root Cause

In convex/skills.ts at line 3191, the code was:

await ctx.db.patch(skill._id, {
  // ...
  moderationStatus: 'hidden',
  moderationReason,
  moderationNotes,
  // ...
})

This logic made sense for NEW skills (which should start hidden pending scan), but was incorrect for UPDATES to existing skills.

Solution

Now we detect if this is an update (skill already has a latestVersionId) and preserve the existing moderation status if the skill is currently active:

const isUpdate = Boolean(latestBefore)
const shouldPreserveStatus = isUpdate && skill.moderationStatus === 'active'
const nextModerationStatus = shouldPreserveStatus ? skill.moderationStatus : 'hidden'

Test Plan

  • All existing tests pass (400 tests)
  • Code only affects the skill update flow, not new skill creation
  • For new skills: still starts as hidden pending scan
  • For updates to active skills: preserves active status
  • For updates to hidden skills: stays hidden

Expected Behavior After Fix

  1. New skill published → starts as hidden (pending scan) → becomes active after scan passes
  2. Active skill updated → stays active during scan → remains active (no disappearance)
  3. Hidden skill updated → stays hidden (doesn't auto-activate)

Affected Users

This fix will help users affected by:

  • Issue #134 (diarybeast, Prezentit, and others)
  • Issue #131 (skill with 175 downloads disappeared)

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Greptile Overview

Greptile Summary

This PR updates insertVersion in convex/skills.ts so that publishing a new version of an already-active skill does not forcibly set moderationStatus: 'hidden' (preventing updated skills from disappearing from search/listings). New skills still start hidden pending scan, and hidden skills remain hidden on update.

The change fits into the existing moderation model used by getBySlug, which uses moderationStatus/moderationReason plus moderationFlags (e.g. malware/suspicious) to decide what non-owners can see and what moderation info is exposed.

Confidence Score: 4/5

  • Mostly safe to merge, but a moderation metadata edge case should be addressed.
  • Core behavior change is small and targeted (preserve moderation status for active-skill updates). The remaining concern is that updates can clear existing moderationFlags, which affects visibility/transparency decisions and could unintentionally remove malware/suspicious labeling.
  • convex/skills.ts (insertVersion moderation patch logic)

Last reviewed commit: 78adda1

Context used:

  • Context from dashboard - AGENTS.md (source)

🔄 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/274 **Author:** [@superlowburn](https://github.com/superlowburn) **Created:** 2/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/skill-disappears-on-update` --- ### 📝 Commits (1) - [`78adda1`](https://github.com/openclaw/clawhub/commit/78adda1d4e827683e5b6b23d877b8b5adec0a772) fix: preserve moderation status when updating existing skills (#134) ### 📊 Changes **1 file changed** (+11 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `convex/skills.ts` (+11 -3) </details> ### 📄 Description Fixes #134 ## Problem When users published updates to existing skills, the skills would immediately disappear from search and listings, even if they had downloads and stars. This affected multiple users (#134, #131). The issue was that `insertVersion` was setting `moderationStatus: 'hidden'` unconditionally for ALL skill versions, including updates to existing active skills. ## Root Cause In `convex/skills.ts` at line 3191, the code was: ```typescript await ctx.db.patch(skill._id, { // ... moderationStatus: 'hidden', moderationReason, moderationNotes, // ... }) ``` This logic made sense for NEW skills (which should start hidden pending scan), but was incorrect for UPDATES to existing skills. ## Solution Now we detect if this is an update (skill already has a `latestVersionId`) and preserve the existing moderation status if the skill is currently active: ```typescript const isUpdate = Boolean(latestBefore) const shouldPreserveStatus = isUpdate && skill.moderationStatus === 'active' const nextModerationStatus = shouldPreserveStatus ? skill.moderationStatus : 'hidden' ``` ## Test Plan - [x] All existing tests pass (400 tests) - [x] Code only affects the skill update flow, not new skill creation - [x] For new skills: still starts as `hidden` pending scan ✅ - [x] For updates to active skills: preserves `active` status ✅ - [x] For updates to hidden skills: stays `hidden` ✅ ## Expected Behavior After Fix 1. **New skill published** → starts as `hidden` (pending scan) → becomes `active` after scan passes 2. **Active skill updated** → stays `active` during scan → remains `active` (no disappearance) 3. **Hidden skill updated** → stays `hidden` (doesn't auto-activate) ## Affected Users This fix will help users affected by: - Issue #134 (diarybeast, Prezentit, and others) - Issue #131 (skill with 175 downloads disappeared) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates `insertVersion` in `convex/skills.ts` so that publishing a new version of an already-active skill does **not** forcibly set `moderationStatus: 'hidden'` (preventing updated skills from disappearing from search/listings). New skills still start hidden pending scan, and hidden skills remain hidden on update. The change fits into the existing moderation model used by `getBySlug`, which uses `moderationStatus`/`moderationReason` plus `moderationFlags` (e.g. malware/suspicious) to decide what non-owners can see and what moderation info is exposed. <h3>Confidence Score: 4/5</h3> - Mostly safe to merge, but a moderation metadata edge case should be addressed. - Core behavior change is small and targeted (preserve moderation status for active-skill updates). The remaining concern is that updates can clear existing `moderationFlags`, which affects visibility/transparency decisions and could unintentionally remove malware/suspicious labeling. - convex/skills.ts (insertVersion moderation patch logic) <sub>Last reviewed commit: 78adda1</sub> <!-- greptile_other_comments_section --> **Context used:** - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=a1d58d20-b4dd-4cbb-973a-9fd7824e1921)) <!-- /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:47 -05:00
yindo closed this issue 2026-02-15 17:16:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#307