Skip to content

fix(api,client): resolve missing OG metadata for short URLs and minif…#309

Open
SarthakDudhe wants to merge 1 commit into
QuoteVote:mainfrom
SarthakDudhe:fix/og-metadata-short-urls
Open

fix(api,client): resolve missing OG metadata for short URLs and minif…#309
SarthakDudhe wants to merge 1 commit into
QuoteVote:mainfrom
SarthakDudhe:fix/og-metadata-short-urls

Conversation

@SarthakDudhe
Copy link
Copy Markdown

@SarthakDudhe SarthakDudhe commented May 1, 2026

Description

This PR resolves an issue where social media link previews (Open Graph metadata) were not correctly displaying for shared quote posts, especially when using shortened URLs or in production environments.

The fix addresses two root causes:

  1. Backend Cast Error: Updated the getPost resolver to support finding posts by both standard ObjectId and short urlId (e.g., e_6A4M), preventing Cast to ObjectId failed errors.
  2. Regex Hardening: Hardened the Edge Function's HTML replacement logic to robustly match meta tags even when they are minified by the build process (stripping whitespace and slashes).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Chore (refactoring, documentation, or other non-functional changes)

Related Issue

Fixes #230

Checklist:

  • I have read the Contributing Guidelines.
  • My code follows the Code Style of this project.
  • I have added tests that prove my fix is effective or that my feature works. See Testing Guidelines.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.

…ied HTML

Modified getPost resolver to support urlId and hardened edge function regexes. Fixes QuoteVote#230
@netlify
Copy link
Copy Markdown

netlify Bot commented May 1, 2026

Deploy Preview for quotevote ready!

Name Link
🔨 Latest commit 4f31702
🔍 Latest deploy log https://app.netlify.com/projects/quotevote/deploys/69f4a9b56ba58800088802c6
😎 Deploy Preview https://deploy-preview-309--quotevote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@flyblackbox
Copy link
Copy Markdown
Contributor

Thank you @SarthakDudhe for your great work! @Om7035 will review and provide feedback or merge

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.

Enhancement: Descriptive Open Graph Metadata for Specific Quote Link Shares

3 participants