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

Conversation

hbjORbj
Copy link
Contributor

@hbjORbj hbjORbj commented Nov 23, 2024

What does this PR do?

  • Read my comments please, let's discuss there
  • Fixes CAL-4764

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A - I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

@graphite-app graphite-app bot requested a review from a team November 23, 2024 10:03
@hbjORbj hbjORbj changed the title fix: og preview image for org events fix: incorrect og preview image for org events Nov 23, 2024
@hbjORbj hbjORbj changed the title fix: incorrect og preview image for org events fix: outdated/broken og preview image for org events Nov 23, 2024
@dosubot dosubot bot added the 🐛 bug Something isn't working label Nov 23, 2024
@hbjORbj hbjORbj marked this pull request as draft November 23, 2024 10:03
@keithwillcode keithwillcode added consumer core area: core, team members only labels Nov 23, 2024
Copy link

graphite-app bot commented Nov 23, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (11/23/24)

1 reviewer was added to this PR based on Keith Williams's automation.

@@ -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

@@ -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

@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

Copy link

linear bot commented Nov 23, 2024

Copy link
Contributor

E2E results are ready!

Copy link
Contributor

@joeauyeung joeauyeung left a comment

Choose a reason for hiding this comment

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

Had a discussion with @hbjORbj about this. This won't break personal links so let's move ahead with this fix.

@hbjORbj hbjORbj merged commit d1adfa3 into main Nov 25, 2024
64 of 86 checks passed
@hbjORbj hbjORbj deleted the fix/og-preview-image branch November 25, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working consumer core area: core, team members only ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants