Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: outdated/broken og preview image for org events #17812

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/lib/OgImages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export const Meeting = ({ title, users = [], profile }: MeetingImageProps) => {
const avatars = attendees
.map((user) => {
if ("image" in user && user?.image) return user.image;
if ("username" in user && user?.username) return `${CAL_URL}/${user.username}/avatar.png`;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I think this line might be the issue is 👇

Let's use one of our org event as an example. https://i.cal.com/support/intercom-support?date=2024-11-25&month=2024-11

This shows this broken preview image:
Screenshot 2024-11-23 at 5 05 36 AM

If we inspect the page and see the <meta/> element for og:image, we have this URL:

https://cal.com/_next/image?w=1200&q=100&url=%2Fapi%2Fsocial%2Fog%2Fimage%3Ftype%3Dmeeting%26title%3DIntercom%2520Support%26meetingProfileName%3DSupport%26meetingImage%3Dhttps%253A%252F%252Fcal.com%252Fapi%252Favatar%252Fb0b58752-68ad-4c0d-8024-4fa382a77752.png%26names%3DMilos%2520Puac%26usernames%3Dmilos

which throws 502 cloudflare error. But if we remove %26usernames%3Dmilos, then it renders well:

https://cal.com/_next/image?w=1200&q=100&url=%2Fapi%2Fsocial%2Fog%2Fimage%3Ftype%3Dmeeting%26title%3DIntercom%2520Support%26meetingProfileName%3DSupport%26meetingImage%3Dhttps%253A%252F%252Fcal.com%252Fapi%252Favatar%252Fb0b58752-68ad-4c0d-8024-4fa382a77752.png%26names%3DMilos%2520Puac

Copy link
Contributor Author

@hbjORbj hbjORbj Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this line? I couldn't find relevant code storing users' avatars in ${user.username}/avatar.png. anyways

return null;
})
.filter(Boolean) as string[];
Expand Down
Loading