Repository navigation
Conversation
A plugin named "New" gets the slug `new`, and /plugins/new is the submission form, which Next.js resolves before [slug]; the listing is unreachable. Same for `opengraph-image`. Append `-plugin` to those two derived slugs in generate_plugin_slug before the duplicate check.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
generate_plugin_slugderives the slug from the plugin name, and the app always inserts without a slug (apps/cursor/src/lib/plugins/insert.ts). A plugin namedNew(ornew!,NEW) gets the slugnew, and/plugins/newis the submission form (apps/cursor/src/app/plugins/new/page.tsx). Next.js resolves the static segment before[slug], so every link to that plugin, including the one the submitter is redirected to after creating it, opens the form instead of the listing.opengraph-imageis the other static sibling underapps/cursor/src/app/plugins/.next.config.mjsalready carvesnewout of the/mcp/:slugredirect for the same reason, so the name is a known hazard on the routing side but not on the slug side.Fix
One migration that replaces
generate_plugin_slug: when the derived slug isneworopengraph-image, append-pluginbefore the existing duplicate check. Explicit slugs, existing rows and every other name are unchanged. No TypeScript change is needed because the app never setsplugins.slugitself.Verification
Ran the base-schema function and the migration against a scratch table in
postgres:16:Newnewnew-plugin(ornew-plugin-<6 hex>when taken)new!,NEWnew-<6 hex>new-plugin-<6 hex>Opengraph Imageopengraph-imageopengraph-image-pluginNew Relic,Hello Worldslug = 'new-explicit'No open PR or issue touches
generate_plugin_slugor the/plugins/newroute.