Skip to content

Comments

fix ogimage unique constraint on resource registration#642

Open
285729101 wants to merge 1 commit intoMerit-Systems:mainfrom
285729101:fix/ogimage-constraint
Open

fix ogimage unique constraint on resource registration#642
285729101 wants to merge 1 commit intoMerit-Systems:mainfrom
285729101:fix/ogimage-constraint

Conversation

@285729101
Copy link

Fixes the unique constraint conflict when registering resources whose origins share OG image URLs.

The Promise.all upsert could race on the same (originId, url) composite key when the scraped HTML contains duplicate og:image tags. This deduplicates images by URL first (last wins, matching browser behaviour), then upserts them sequentially inside the existing transaction.

Closes #287

@vercel
Copy link
Contributor

vercel bot commented Feb 18, 2026

@285729101 is attempting to deploy a commit to the Merit Systems Team on Vercel.

A member of the Team first needs to authorize it.

@285729101
Copy link
Author

@jasonhedman this fixes a race condition in the OG image generation — deduplicates and processes sequentially to avoid the unique constraint violation. Would appreciate a review.

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.

Bug: Unable to register resource due to OgImage unique constraint conflict

1 participant