improvement(custom-blocks): hardened delete with usage count + per-input required option#5575
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Delete flow: Unpublish now loads org-wide usage counts via Required inputs: Publishers can mark each exposed Start input required (stored in existing Usage counting: Reviewed by Cursor Bugbot for commit 093a5cf. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR hardens custom block deletion and adds required input controls. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "fix(custom-blocks): escape LIKE wildcard..." | Re-trigger Greptile |
56b2349 to
3384be6
Compare
|
@greptile review |
3384be6 to
416a640
Compare
|
@greptile review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit df17670. Configure here.

Summary
GET /api/custom-blocks/[id]/usagesendpoint returning{ usageCount, deployedUsageCount }— a workflow counts when the block appears in its live editor state or its ACTIVE deployment snapshot (scanned independently with a cheap text pre-filter before the jsonb parse, so a block removed in the editor but still deployed is counted). Same manage authz as deleteinputsoverrides column, no migration). The consumer block gets the standard required asterisk + pre-deploy gate via the serializer's existing required-subBlock validation, and runs enforce it in the workflow handler against the child's live deployed Start fields — so a required override for a removed field is inert and newly added fields stay optional (schema drift never blocks a run)authorizeManageinto a shared module for the[id]routesType of Change
Testing
Tested manually. Route tests for the usage-counts endpoint (401/404/403/200) and unit tests for required-input enforcement (empty/filled, stale-override, added-field, legacy name-keyed, multi-field).
lint,check:api-validation:strict,check:migrations(no new migrations), andcheck:react-querypass; usage SQL exercised against a live database.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01Jc1SjzdZkiyVLqUmCS1x9H