Skip to content

fix(community): missing unpublish listing is a caller error (KODY-CLOUDFLARE-4N) - #1429

Merged
kentcdodds merged 1 commit into
mainfrom
cursor/sentry-triage-kody-cloudflare-kody-cloudflare-4n-0895
Aug 13, 2026
Merged

kentcdodds merged 1 commit into
mainfrom
cursor/sentry-triage-kody-cloudflare-kody-cloudflare-4n-0895

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Sentry

  • Issue: KODY-CLOUDFLARE-4N
  • Signature: Error: Community listing "<id>" was not found.
  • Culprit: unpublishCommunityListing via community_unpublish
  • Tags: mcp.capability=community_unpublish, mcp.failure_phase=handler

Root cause

unpublishCommunityListing threw a plain Error when the listing id was missing or owned by someone else. MCP observability only suppresses CommunityActionError / McpCallerError for caller-clearable failures, so a stale or mistyped listing_id opened a Sentry issue that looked like a platform bug.

Delisted listings already used CommunityActionError; missing/unowned did not — an inconsistency with star/rate/trust paths in the same module.

Fix

Throw CommunityActionError for missing/unowned (and post-delete race) cases in unpublishCommunityListing, and for missing listings in prepareCommunityFork (same message class). Callers still get the same actionable message; Sentry no longer receives these events.

Verification

  • Unit: unpublishCommunityListing treats missing or unowned listings as CommunityActionError
  • Existing observability coverage already asserts CommunityActionError is not reported to Sentry
System recap — composes existing primitives (low risk)

Mode: recap · Base: main @ d2a56885 · Head: 948a6ba3

Classification: composes — isolated bug fix; aligns missing-listing throws with the existing CommunityActionError caller-failure path already filtered by MCP observability.

Primitives touched

Primitive Group Impact
community-listings assistant composes — same public message; error class matches sibling community actions

System map

Missing or unowned listing_id on unpublish becomes a caller-clearable CommunityActionError, so MCP logs the failure without opening a Sentry issue.

Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context (unchanged, included only when an edge crosses it).

flowchart LR
	mcpCap["mcp-server<br/>community_unpublish"]:::untouched
	listings["community-listings<br/>unpublishCommunityListing"]:::touched
	obs["mcp observability<br/>isCallerFailure"]:::untouched
	sentry["Sentry"]:::untouched
	mcpCap -->|"listing_id missing / unowned"| listings
	listings -->|"CommunityActionError"| obs
	obs -->|"suppress"| sentry
	classDef touched fill:#1a7f37,color:#fff
	classDef extended fill:#9a6700,color:#fff
	classDef added fill:#cf222e,color:#fff
	classDef untouched fill:#57606a,color:#fff
Loading

Before / after

Case Before After
Missing / unowned listing on community_unpublish plain Error → Sentry issue CommunityActionError → mcp-event only
Delisted listing already CommunityActionError unchanged

Invariants

No change to ownership checks or per-user isolation; not-found still hides other owners' listings.

Open in Web Open in Cursor 

Summary by CodeRabbit

  • Bug Fixes
    • Standardized errors shown when attempting to unpublish missing, delisted, or unowned community listings.
    • Prevented deletion attempts when a listing cannot be found or is not owned.
    • Improved consistency when preparing community forks for unavailable listings.

unpublishCommunityListing threw a plain Error for missing or unowned
listing ids, which MCP observability reported to Sentry as a platform
bug (KODY-CLOUDFLARE-4N). Use CommunityActionError like the rest of the
community surface so these stay on mcp-event lines only.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kentcdodds
kentcdodds marked this pull request as ready for review August 13, 2026 16:40
@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a0121b7-a9b0-4c40-8b80-8187b8f33425

📥 Commits

Reviewing files that changed from the base of the PR and between d2a5688 and 948a6ba.

📒 Files selected for processing (2)
  • packages/worker/src/community/community-service.node.test.ts
  • packages/worker/src/community/service.ts

📝 Walkthrough

Walkthrough

Community listing unpublish and fork operations now use CommunityActionError for invalid listing states. Tests cover missing, unowned, delisted, and failed-deletion cases.

Changes

Community action error consistency

Layer / File(s) Summary
Community action error handling
packages/worker/src/community/service.ts, packages/worker/src/community/community-service.node.test.ts
unpublishCommunityListing and prepareCommunityFork now throw CommunityActionError for invalid listings and failed deletion. Tests verify error types, the missing-listing message, and that deletion is skipped.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to 948a6

This localized change reclassifies missing or unowned listings as caller errors without changing the user-facing message or ownership behavior. No actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

  • kentcdodds/kody#1138: Updates community actions to use CommunityActionError for invalid listing operations.
  • kentcdodds/kody#1318: Changes community listing operations to use caller-specific errors for missing or delisted listings.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the community unpublish error-handling fix and matches the primary change.
Description check ✅ Passed The description explains the intent, root cause, fix, affected behavior, and verification, although it does not use the template headings exactly.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/sentry-triage-kody-cloudflare-kody-cloudflare-4n-0895

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.

@github-actions

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-1429.kody-a99.workers.dev

Worker: kody-pr-1429
Runtime worker: kody-pr-1429-runtime (https://kody-pr-1429-runtime.kody-a99.workers.dev)
D1: kody-pr-1429-db
KV: kody-pr-1429-oauth-kv

Mocks:

@kentcdodds
kentcdodds merged commit 73ff76f into main Aug 13, 2026
18 checks passed
@kentcdodds
kentcdodds deleted the cursor/sentry-triage-kody-cloudflare-kody-cloudflare-4n-0895 branch August 13, 2026 16:49
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.

2 participants