fix: key meta tags by property so og:* tags stop collapsing#1
Merged
MatthewPattell merged 1 commit intoJun 24, 2026
Merged
Conversation
buildKeyByProps only treated id/name/href/src as unique attributes, so og:* tags (which use property=) fell through to the prop-name fallback and all collided on the same key (meta[property][content]), last-write- wins -> only og:image survived sitewide. Add property to the unique-attr list so each og:* tag keeps a distinct key. Adds a regression test.
Contributor
Author
|
@MatthewPattell review please — sitewide OG fix, one-line root cause, regression test red→green, full suite green. I lack write here so this is a fork PR; merge + publish is yours. |
MatthewPattell
approved these changes
Jun 24, 2026
|
🎉 This PR is included in version 2.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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 (live on prod, sitewide)
Every page on lomray.com renders only a single
og:imageOpen Graph tag —og:title,og:description,og:url,og:type,og:site_name,og:localeare all missing, even though the app'sMetaDatacomponent emits them. (Verified by raw curl on home, a blog article, and/services/web-development— all show 1×og:image, 0× every otherog:*. The 4twitter:*tags survive.)Root cause
Manager.buildKeyByPropsonly treats['id', 'name', 'href', 'src']as unique attributes.twitter:*tags usename=so each gets a distinct key and survives.og:*tags useproperty=— none of the unique attrs match, so they fall through to the prop-name fallback which builds the key from prop names ([property][content]), not values. Result: every<meta property=… content=…>collapses to the identical keymeta[property][content], last-write-wins — only the last og tag (og:image) survives.Fix
Add
propertyto the unique-attr list so eachog:*tag keeps a distinct key (meta[property='og:title'], etc). One line.Tests
Added a regression test asserting 4 distinct
og:*tags survive. Proven red→green: on the unfixed code it failsexpected 1 to equal 4(reproducing the prod symptom); with the fix the full suite is green (5/5).ts:check, eslint, and rollup build all clean.Consumed by
lomray-websiteat@lomray/react-head-manager@^2.0.2; after publish I'll bump the dep there.