Fix OG image 500s and stop install rate limits logging as errors#398
Merged
Merged
Conversation
OG image routes were 500ing (~5% of traffic) on relative logo URLs and Satori layout constraints. Normalize image src to absolute URLs, add explicit display:flex on multi-child nodes, and set Cache-Control plus a 1d revalidate so social crawlers hit cached PNGs. track-install now returns a non-throwing rate-limit result instead of throwing ActionError, so expected rate limiting no longer shows up as error-level logs. The client only increments the count on success and toasts on rate limit. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced May 26, 2026
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.
Summary
srcto absolute URLs viaresolveOgImageUrl, add explicitdisplay: flexon multi-child nodes, and setCache-ControlonImageResponseso social crawlers hit cached PNGs instead of regenerating.revalidate = 86400to the OG routes. Listing OG routes (/,/plugins,/members,/login,/companies,/plugins/new) prerender as ISR-static; the slug routes (/plugins/[slug],/u/[slug],/c/[slug]) stay dynamic but still benefit from response caching.track-installnow returns a non-throwing result ({ tracked }/{ rateLimited }) instead of throwingActionError, so expected install rate limiting no longer floods Vercel error-level logs. The client only increments the count on success and shows a toast when rate limited.Background
Production log analysis on
anysphere/cursor-directorysurfaced two recurring issues:/plugins/[slug]/opengraph-imagereturning 500 (Image source must be an absolute URL,Expected <div> to have explicit "display: flex").Action error: Rate limit exceedederror logs from thetrack-installserver action — expected UX, but logged as errors.Test plan
npm run buildsucceeds; build route table shows listing OG routes as Static (○, revalidate 1d) and slug OG routes as Dynamic (ƒ).prerender-manifest.jsonconfirmsinitialRevalidateSeconds: 86400andCache-Controlheaders on prerendered OG routes.Made with Cursor
Note
Low Risk
Targeted rendering and logging/UX fixes; install counting behavior is slightly stricter (no optimistic bump on rate limit) but RPC path is unchanged on success.
Overview
Fixes Open Graph route 500s and cuts noise from expected install rate limits in production logs.
OG images now use
resolveOgImageUrlso Satori gets absolutehttp(s)URLs when logos/avatars are stored as site-relative paths. Several OG JSX nodes gain explicitdisplay: flexfor Satori layout rules.createOGResponsesets day-longCache-Controlon PNG responses, and OG routes exportrevalidate = 86400so listing images can ISR and crawlers reuse cached output.track-installstops throwing on rate limit: it returns{ tracked: true }or{ tracked: false, rateLimited: true }.plugin-detailonly bumps the install count when tracking succeeds and shows a toast when rate limited, instead of optimistically incrementing and logging server errors.Reviewed by Cursor Bugbot for commit 913f049. Bugbot is set up for automated code reviews on this repo. Configure here.