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

feat: add metadata content in lender profile for badge share #5610

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

christian14b
Copy link
Collaborator

Share metadata for badge share

@christian14b christian14b requested review from emuvente and a team October 18, 2024 17:14
},
const utmCampaign = currentRoute?.query?.utm_campaign ?? '';
const loadBadgeInfo = utmCampaign.includes('badge_') && utmCampaign.includes('social_share');
const badgeKey = utmCampaign.split('badge_')[1];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we be checking if badgeKey is defined and acting different below if it's not defined?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mmm yeah, probably should be good to see if the badgeKey exist in contentful. I think I saw a list of badge keys that I can add here as an extra validation

},
completedAchievements() {
return this.allAchievements.filter(achievement => achievement.status === 'COMPLETE');
},
},
methods: {
loadBadgeInfo(badgeKey) {
const data = this.apollo.readQuery({
Copy link
Collaborator

Choose a reason for hiding this comment

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

We'll want a try catch around this, with logReadQueryError in the catch

const utmCampaign = this.$route?.query?.utm_campaign ?? '';
if (utmCampaign.includes('badge_') && utmCampaign.includes('social_share')) {
const badgeKey = utmCampaign.split('badge_')[1];
this.loadBadgeInfo(badgeKey);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need await this query so that the data is guaranteed to be there on server render? I see that we're pulling data from this query to add to the page title and whatnot.

@dyersituations
Copy link
Collaborator

@christian14b @emuvente I see in the ticket that this is also needed on the home page, but with the home page being cached, I don't see a great way to update the page title and whatnot on server render. Maybe we can chat with product about using a different, non-cached page?

@emuvente
Copy link
Collaborator

I see in the ticket that this is also needed on the home page, but with the home page being cached, I don't see a great way to update the page title and whatnot on server render. Maybe we can chat with product about using a different, non-cached page?

@dyersituations Fastly treats URLs with different query parameters as separate cache objects unless we explicitly tell it not to https://docs.fastly.com/en/guides/making-query-strings-agnostic. So each different utm_campaign value will have a separate cached page.

@dyersituations
Copy link
Collaborator

I see in the ticket that this is also needed on the home page, but with the home page being cached, I don't see a great way to update the page title and whatnot on server render. Maybe we can chat with product about using a different, non-cached page?

@dyersituations Fastly treats URLs with different query parameters as separate cache objects unless we explicitly tell it not to https://docs.fastly.com/en/guides/making-query-strings-agnostic. So each different utm_campaign value will have a separate cached page.

Ah yup, that's right, I forgot about the query params existing, thanks!

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.

3 participants